实验二十三PPP协议中的CHAP和PAP验证.docx
- 文档编号:7195731
- 上传时间:2023-01-21
- 格式:DOCX
- 页数:14
- 大小:21.22KB
实验二十三PPP协议中的CHAP和PAP验证.docx
《实验二十三PPP协议中的CHAP和PAP验证.docx》由会员分享,可在线阅读,更多相关《实验二十三PPP协议中的CHAP和PAP验证.docx(14页珍藏版)》请在冰豆网上搜索。
实验二十三PPP协议中的CHAP和PAP验证
实验二十三:
PPP协议中的CHAP和PAP验证
一、理论基础
1.PPP协议
PPP协议是在SLIP(SerialLineIP串行线IP协议)的基础上发展起来的。
由于SLIP协议只支持异步传输方式、无协商过程(尤其不能协商如双方IP地址等网络层属性)等缺陷,在以后的发展过程中,逐步被PPP协议所代替。
人们创建了PPP协议以解决远程互连网的连接问题。
另外,需要采用PPP协议来解决动态分配IP地址以及多协议使用的问题。
PPP可以在同步和异步电路中提供路由器到路由器以及主机到网络的连接。
PPP是目前使用最普遍、最流行的WAN协议,是一种标准的串行线路封装方式,这种协议在连接建立期间可以检查链路的质量。
2、PPP协议的特点
(1)动态分配IP地址(例如拨号上网时)
(2)支持多种网络层协议
(3)误码检测
(4)多链路绑定(Multilink)
(5)数据的压缩
(6)链路配置以及链路质量测试
(7)回叫(Callback)
(8)网络能力的协商选项,如:
网络层地址协商和数据压缩协商等
PPP定义了一整套的协议,包括链路控制协议(LCP)、网络层控制协议(NCP)和验证协议(PAP和CHAP)等。
其中,链路控制协议LCP(LinkControlProtocol):
用来协商链路的一些参数,负责创建并维护链路。
网络层控制协议NCP(NetworkControlProtocol):
用来协商网络层协议的参数。
3、PPP建立一个点到点连接的四个阶段
(1)链路的建立和配置协商
(2)链路质量确定
(3)网络层协议配置协商
(4)链路拆除
4、PPP的验证方式
PAP验证
PAP(PasswordAuthenticationProtocol,口令鉴定协议)是一种两次握手验证协议,它在网络上采用明文方式传输用户名和口令。
PAP验证的过程如下:
被验证方主动发起验证请求,将本端的用户名和口令发送到验证方;
验证方接到被验证方的验证请求后,检查此用户名是否存在以及口令是否正确。
如果此用户名存在且口令正确,验证方返回Acknowledge响应,表示验证通过;如果此用户名不存在或口令错误。
验证方返回NotAcknowledge响应,表示验证不通过。
CHAP验证
CHAP(ChallengeHandshakeAuthenticationProtocol,质询握手鉴定协议)是一种三次握手验证协议,它只在网络上传输用户名,而用户口令并不在网络上传播。
CHAP验证过程如下:
验证方主动发起验证请求,向被验证方发送一些随机产生的报文,并同时将本端配置的用户名附带上一起发送给被验证方;
被验证方接到验证方的验证请求后,根据此报文中的用户名在本端的用户表中查找用户口令。
如找到用户表中与验证方用户名相同的用户,便利用报文ID和此用户的口令以MD5算法生成应答,随后将应答和自己的用户名送回;
验证方接收到此应答后,利用报文ID、自己保存的被验证方口令以及随机报文用MD5算法得出结果,与被验证方应答比较。
如果两者相同,则返回Acknowledge响应,表示验证通过,如果两者不相同,则返回NotAcknowledge相应,表示验证不通过。
二、实验案例
1、实验拓扑结构图:
2、配置说明:
Router1的S0:
192.168.1.10子网掩码:
255.255.255.0
Router2的S0:
192.168.1.20子网掩码:
255.255.255.0
3、具体配置:
方法一:
PAP验证
PAP的单向验证
Router1的配置:
[Router1]ints0
[Router1-Serial0]ipaddress192.168.10.1255.255.255.0
[Router1-Serial0]
%15:
01:
45:
LineprotocolipontheinterfaceSerial0isUP
[Router1-Serial0]link-protocolppp
[Router1-Serial0]ppppaplocal-usersunkepasswordsimplesunke
[Router1]discur
Nowcreateconfiguration...
Currentconfiguration
version1.74
sysnameRouter1
firewallenable
aaa-enable
aaaaccounting-schemeoptional
interfaceAux0
asyncmodeflow
link-protocolppp
interfaceEthernet0
interfaceEthernet1
interfaceSerial0
clockDTECLK1
link-protocolppp
ppppaplocal-usersunkepasswordsimplesunke
ipaddress192.168.10.1255.255.255.0
interfaceSerial1
link-protocolppp
interfaceSerial2
link-protocolppp
interfaceSerial3
link-protocolppp
Return
Router2的配置:
[Router2]ints0
[Router2-Serial0]ipaddress192.168.10.2255.255.255.0
[Router2-Serial0]
%15:
12:
53:
LineprotocolipontheinterfaceSerial0isUP
[Router2-Serial0]link-protocolppp
[Router2]local-usersunkeservice-typeppppasswordsimplesunke
[Router2-Serial0]pppauthentication-modepap
[Router2]dsicur
Incorrectcommand
[Router2]discur
Nowcreateconfiguration...
Currentconfiguration
version1.74
local-usersunkeservice-typeppppasswordsimplesunke
sysnameRouter2
firewallenable
aaa-enable
aaaaccounting-schemeoptional
interfaceAux0
asyncmodeflow
link-protocolppp
interfaceEthernet0
interfaceSerial0
link-protocolppp
pppauthentication-modepap
ipaddress192.168.10.2255.255.255.0
interfaceSerial1
link-protocolppp
interfaceSerial2
link-protocolppp
interfaceSerial3
link-protocolppp
Return
测试结果:
[Router1]ping192.168.10.2
PING192.168.10.2:
56databytes,pressCTRL_Ctobreak
Replyfrom192.168.10.2:
bytes=56Sequence=0ttl=255time=27ms
Replyfrom192.168.10.2:
bytes=56Sequence=1ttl=255time=26ms
Replyfrom192.168.10.2:
bytes=56Sequence=2ttl=255time=26ms
Replyfrom192.168.10.2:
bytes=56Sequence=3ttl=255time=26ms
Replyfrom192.168.10.2:
bytes=56Sequence=4ttl=255time=26ms
---192.168.10.2pingstatistics---
5packetstransmitted
5packetsreceived
0.00%packetloss
round-tripmin/avg/max=26/26/27ms
[Router2]ping192.168.10.1
PING192.168.10.1:
56databytes,pressCTRL_Ctobreak
Replyfrom192.168.10.1:
bytes=56Sequence=0ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=1ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=2ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=3ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=4ttl=255time=26ms
---192.168.10.1pingstatistics---
5packetstransmitted
5packetsreceived
0.00%packetloss
round-tripmin/avg/max=26/26/26ms
PAP的双向验证
Router2添加的配置:
[Router2]ints0
[Router2-Serial0]ppppaplocal-userdjwpasswordsimpledjw
Router1添加的配置:
[Router1]local-userdjwservice-typeppppasswordsimpledjw
[Router1-Serial0]pppauthentication-modepap
[Router1-Serial0]discur
Nowcreateconfiguration...
Currentconfiguration
version1.74
local-userdjwservice-typeppppasswordsimpledjw
sysnameRouter1
firewallenable
aaa-enable
aaaaccounting-schemeoptional
interfaceAux0
asyncmodeflow
link-protocolppp
interfaceEthernet0
interfaceEthernet1
interfaceSerial0
clockDTECLK1
link-protocolppp
pppauthentication-modepap
ppppaplocal-usersunkepasswordsimplesunke
ipaddress192.168.10.1255.255.255.0
interfaceSerial1
link-protocolppp
interfaceSerial2
link-protocolppp
interfaceSerial3
link-protocolppp
Return
再次测试结果:
[Router1]ping192.168.10.2
PING192.168.10.2:
56databytes,pressCTRL_Ctobreak
Replyfrom192.168.10.2:
bytes=56Sequence=0ttl=255time=26ms
Replyfrom192.168.10.2:
bytes=56Sequence=1ttl=255time=26ms
Replyfrom192.168.10.2:
bytes=56Sequence=2ttl=255time=26ms
Replyfrom192.168.10.2:
bytes=56Sequence=3ttl=255time=26ms
Replyfrom192.168.10.2:
bytes=56Sequence=4ttl=255time=26ms
---192.168.10.2pingstatistics---
5packetstransmitted
5packetsreceived
0.00%packetloss
round-tripmin/avg/max=26/26/26ms
[Router2]ping192.168.10.1
ING192.168.10.1:
56databytes,pressCTRL_Ctobreak
Replyfrom192.168.10.1:
bytes=56Sequence=0ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=1ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=2ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=3ttl=255time=26ms
Replyfrom192.168.10.1:
bytes=56Sequence=4ttl=255time=26ms
---192.168.10.1pingstatistics---
5packetstransmitted
5packetsreceived
0.00%packetloss
round-tripmin/avg/max=26/26/26ms
方法二:
CHAP验证
CHAP的单向验证
Router1的配置:
[Router1]ints0
[Router1-Serial0]ipaddress192.168.1.10255.255.255.0
[Router1-Serial0]link-protocolppp
[Router1-Serial0]pppchapusersunke
[Router1-Serial0]pppchappasswordsimplesunke
[Router1]discur
Nowcreateconfiguration...
Currentconfiguration
version1.74
sysnameRouter1
firewallenable
aaa-enable
aaaaccounting-schemeoptional
interfaceAux0
asyncmodeflow
link-protocolppp
interfaceEthernet0
interfaceSerial0
link-protocolppp
pppchapusersunke
pppchappasswordsimplesunke
ipaddress192.168.1.10255.255.255.0
interfaceSerial1
link-protocolppp
interfaceSerial2
link-protocolppp
interfaceSerial3
link-protocolppp
Return
Router2的配置:
[Router]sysRouter2
[Router2]ints0
[Router2-Serial0]ipaddress192.168.1.20255.255.255.0
[Router2-Serial0]
%16:
18:
40:
LineprotocolipontheinterfaceSerial0isUP
[Router2]local-usersunkeservice-typeppppasswordsimplesunke
[Router2]ints0
[Router2-Serial0]link-protocolppp
[Router2-Serial0]pppauthentication-modechap
[Router2-Serial0]pppchapuserdjw
[Router2]discur
Nowcreateconfiguration...
Currentconfiguration
version1.74
local-usersunkeservice-typeppppasswordsimplesunke
sysnameRouter2
firewallenable
aaa-enable
aaaaccounting-schemeoptional
interfaceAux0
asyncmodeflow
link-protocolppp
interfaceEthernet0
interfaceEthernet1
interfaceSerial0
clockDTECLK1
link-protocolppp
pppauthentication-modechap
pppchapuserdjw
ipaddress192.168.1.20255.255.255.0
interfaceSerial1
link-protocolppp
interfaceSerial2
link-protocolppp
interfaceSerial3
link-protocolppp
Return
测试结果:
[Router2]ping192.168.1.10
PING192.168.1.10:
56databytes,pressCTRL_Ctobreak
Replyfrom192.168.1.10:
bytes=56Sequence=0ttl=255time=25ms
Replyfrom192.168.1.10:
bytes=56Sequence=1ttl=255time=25ms
Replyfrom192.168.1.10:
bytes=56Sequence=2ttl=255time=26ms
Replyfrom192.168.1.10:
bytes=56Sequence=3ttl=255time=25ms
Replyfrom192.168.1.10:
bytes=56Sequence=4ttl=255time=25ms
---192.168.1.10pingstatistics---
5packetstransmitted
5packetsreceived
0.00%packetloss
round-tripmin/avg/max=25/25/26ms
[Router1]ping192.168.1.20
PING192.168.1.20:
56databytes,pressCTRL_Ctobreak
Replyfrom192.168.1.20:
bytes=56Sequence=0ttl=255time=25ms
Replyfrom192.168.1.20:
bytes=56Sequence=1ttl=255time=25ms
Replyfrom192.168.1.20:
bytes=56Sequence=2ttl=255time=26ms
Replyfrom192.168.1.20:
bytes=56Sequence=3ttl=255time=25ms
Replyfrom192.168.1.20:
bytes=56Sequence=4ttl=255time=30ms
---192.168.1.20pingstatistics---
5packetstransmitted
5packetsreceived
0.00%packetloss
round-tripmin/avg/max=25/26/30ms
CHAP的双向验证
Router1的配置:
[Router1]ints0
[Router1-Serial0]ipaddress192.168.1.10255.255.255.0
[Router1-Serial0]link-protocolppp
[Router1-Serial0]pppchapusersunke
[Router1]local-userdjwservice-typeppppasswordsimplequidway
[Router1]ints0
[Router1-Serial0]pppauthentication-modechap
[Router1-Serial0]
[Router1]discur
Nowcreateconfiguration...
Currentconfiguration
version1.74
local-userdjwservice-typeppppasswordsimplequidway
sysnameRouter1
firewallenable
aaa-enable
aaaaccounting-schemeoptional
interfaceAux0
asyncmodeflow
link-protocolppp
interfaceEthernet0
interfaceSerial0
link-protocolppp
pppauthentication-modechap
pppchapusersunke
ipad
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 实验 十三 PPP 协议 中的 CHAP PAP 验证