实验四 PPP协议实验.docx
《实验四 PPP协议实验.docx》由会员分享,可在线阅读,更多相关《实验四 PPP协议实验.docx(17页珍藏版)》请在冰豆网上搜索。
实验四PPP协议实验
实验四PPP协议实验
1广域网链路认证(PAP)
【背景描述】
你是公司的网络管理员,两个分公司之间希望能够申请一条广域网专线进行连接。
现有锐捷路由器两台,希望你了解该设备的广域网接口所支持的协议,以确定选择哪种广域网链路。
公司为了满足不断增长的业务需求,申请了专线接入,你的客户端与ISP进行链路协商时要验证身份,配置路由器保证链路建立,并考虑其安全性。
【实现功能】
在链路协商时保证安全验证。
链路协商时用户名、密码以明文的方式传输。
【使用设备】
设备类型
设备名称
设备数量
交换机
路由器
Router
2
三层交换机
串口线
1
计算机
【实验拓扑】
【实现步骤】
步骤1基本配置
Router(config)#hostnameRa
Ra(config)#interfaceserial0
Ra(config-if)#ipaddress1.1.1.1255.255.255.0
Ra(config-if)#noshutdown
Ra(config-if)#exit
Router(config)#hostnameRb
Rb(config)#interfaceserial0
Rb(config-if)#ipaddress1.1.1.2255.255.255.0
Rb(config-if)#noshutdown
验证测试:
(以Ra为例)
Ra#showinterfacesserial0
Serial0isup,lineprotocolisup
HardwareisHDLC4530A
Internetaddressis1.1.1.1/24
MTU1500bytes,BW2048Kbit,DLY20000usec,rely255/255,load1/255
EncapsulationHDLC,loopbacknotset,keepaliveset(10sec)
Lastinput00:
00:
09,output00:
00:
08,outputhangnever
Lastclearingof"showinterface"countersnever
Inputqueue:
0/75/0(size/max/drops);Totaloutputdrops:
0
Queueingstrategy:
weightedfair
Outputqueue:
65531/64/0(size/threshold/drops)
Conversations0/1(active/maxactive)
ReservedConversations0/0(allocated/maxallocated)
5minuteinputrate0bits/sec,0packets/sec
5minuteoutputrate0bits/sec,0packets/sec
409packetsinput,57032bytes,0nobuffer
Received404broadcasts
0inputerrors,0CRC,0frame,0overrun,0ignored,0abort
163packetsoutput,4312bytes,0underruns
0outputerrors,0collisions,31interfaceresets
0outputbufferfailures,0outputbuffersswappedout
0carriertransitions
DCD=upDSR=upDTR=upRTS=upCTS=up
步骤2配置PPP认证.
被验证方的配置
Ra(config)#interfaceserial0
Ra(config-if)#encapsulationppp!
在接口下封装PPP协议
Ra(config-if)#ppppapsent-usernameRapassword0star
!
PPP认证的用户名、密码
验证方的配置
Rb(config)#usernameRapassword0star!
验证方配置被验证方的用户名、密码
Rb(config)#interfaceserial0
Rb(config-if)#encapsulationppp
Rb(config-if)#pppauthenticationpap!
PPP启用PAP验证过程
验证测试
Ra#debugpppauthentication!
观察PAP认证过程(这儿认证显示不详细)
PPPauthenticationdebuggingison
Ra#
PPPSerial0:
PAPACK
Remotemessageis:
PPPSerial0:
PassedPAPauthenticationwithremote
参考配置
Ra#showrunning-config!
路由器Ra的配置
Buildingconfiguration...
Currentconfiguration:
!
version6.14(9coll)
!
hostname"Ra"
!
ipsubnet-zero
!
interfaceFastEthernet0
noipaddress
shutdown
!
interfaceFastEthernet1
noipaddress
shutdown
!
interfaceFastEthernet2
noipaddress
shutdown
!
interfaceFastEthernet3
noipaddress
shutdown
!
interfaceSerial0
ipaddress1.1.1.1255.255.255.0
encapsulationppp
ppppapsent-usernameRapassword71234111358
!
interfaceSerial1
noipaddress
shutdown
!
interfaceSerial2
noipaddress
shutdown
!
interfaceSerial3
noipaddress
shutdown
!
ipclassless
!
linecon0
lineaux0
linevty04
login
linevty519
login
!
end
Rb#showrunning-config!
路由器Rb的配置
Buildingconfiguration...
Currentconfiguration:
!
version6.14(9coll)
!
hostname"Rb"
!
usernameRapassword70059344251
!
ipsubnet-zero
!
interfaceFastEthernet0
noipaddress
shutdown
!
interfaceFastEthernet1
noipaddress
shutdown
!
interfaceFastEthernet2
noipaddress
shutdown
!
interfaceFastEthernet3
noipaddress
shutdown
!
interfaceSerial0
ipaddress1.1.1.2255.255.255.0
encapsulationppp
clockrate64000
pppauthenticationpap
!
interfaceSerial1
noipaddress
shutdown
!
ipclassless
!
linecon0
lineaux0
linevty04
login
linevty519
login
!
end
【注意事项】
1.在DCE端配置时钟频率
2.Rb(config)#usernameRapassword0star
!
username后面的参数是对方的主机名
3.在接口下封装PAP认证
4.debugpppauthentication
!
在路由器物理层up,链路尚未建立的情况下打开才有消息输出,
本实验的实质是链路层协商建立的安全性,该信息出现在链路协商的过程中.
2广域网链路认证(CHAP)
【背景描述】
你是网络管理员:
两个分公司之间希望能够申请一条广域网专线进行连接。
公司现有锐捷路由器两台,希望你了解该设备的广域网接口所支持的协议,以确定选择哪种广域网链路。
公司为了满足不断增长的业务需求,申请了专线接入,你的客户端与ISP进行链路协商时要验证身份,配置路由器保证链路建立,并考虑其安全性。
【实现功能】
在链路协商时保证安全验证。
链路协商时以密文的方式传输,更安全。
【使用设备】
设备类型
设备名称
设备数量
交换机
路由器
router
2
三层交换机
串口线
1
计算机
【案例拓扑】
【实现过程】
步骤1基本配置
Router(config)#hostnameRa
Ra(config)#interfaceserial0
Ra(config-if)#ipaddress1.1.1.1255.255.255.0
Ra(config-if)#noshutdown
Router(config)#hostnameRb
Rb(config)#interfaceserial0
Rb(config-if)#ipaddress1.1.1.2255.255.255.0
Rb(config-if)#clockrate64000
Rb(config-if)#noshutdown
验证测试:
(以Ra为例)
Ra#showinterfacesserial0
Serial0isup,lineprotocolisup
HardwareisHDLC4530A
Internetaddressis1.1.1.1/24
MTU1500bytes,BW2048Kbit,DLY20000usec,rely255/255,load1/255
EncapsulationHDLC,loopbacknotset,keepaliveset(10sec)
Lastinput00:
00:
00,output00:
00:
04,outputhangnever
Lastclearingof"showinterface"countersnever
Inputqueue:
0/75/0(size/max/drops);Totaloutputdrops:
0
Queueingstrategy:
weightedfair
Outputqueue:
0/64/0(size/threshold/drops)
Conversations0/1(active/maxactive)
ReservedConversations0/0(allocated/maxallocated)
5minuteinputrate0bits/sec,0packets/sec
5minuteoutputrate0bits/sec,0packets/sec
864packetsinput,66556bytes,0nobuffer
Received484broadcasts
0inputerrors,0CRC,0frame,0overrun,0ignored,0abort
647packetsoutput,14520bytes,0underruns
0outputerrors,0collisions,49interfaceresets
0outputbufferfailures,0outputbuffersswappedout
0carriertransitions
DCD=upDSR=upDTR=upRTS=upCTS=up
步骤2配置PPPPAP认证
Ra(config)#usernameRbpassword0star
!
以对方的主机名作为用户名,密码和对方的路由器配置一致
Ra(config)#interfaceserial0
Ra(config-if)#encapsulationppp
Ra(config-if)#pppauthenticationchap!
PPP启用chap
Rb(config)#usernameRapassword0star
!
以对方的主机名作为用户名,密码和对方路由器一致
Rb(config)#interfaceserial0
Rb(config-if)#encapsulationppp
验证测试
Ra#debugppppacket
PPPpacketdisplaydebuggingison
Ra#
PPPSerial0(i):
pkttype0xC021,datagramsize14
PPPSerial0:
ILCPCONFREQ
(1)id4len10
MAGICNUMBER(6)0xD10x500x300xA7
PPPSerial0:
input(0xC021)state=Opencode=CONFREQ
(1)id=4len=10
PPPSerial0:
OLCPCONFREQ
(1)id73len15
AUTHTYPE(5)0xC20x230x5
MAGICNUMBER(6)0xD10x500x30x88
PPPSerial0:
OLCPCONFACK
(2)id4len10
MAGICNUMBER(6)0xD10x500x300xA7
PPPSerial0(i):
pkttype0xC021,datagramsize19
PPPSerial0:
ILCPCONFACK
(2)id73len15
AUTHTYPE(5)0xC20x230x5
MAGICNUMBER(6)0xD10x500x30x88
PPPSerial0:
input(0xC021)state=ACKsentcode=CONFACK
(2)id=73len=1
PPPSerial0:
OCHAPCHALLENGE
(1)id4len23
PPPSerial0:
SendCHAPchallengeid=4toremote
PPPSerial0(i):
pkttype0xC223,datagramsize27
PPPSerial0:
ICHAPRESPONSE
(2)id4len23
PPPSerial0:
CHAPresponseid=4receivedfromRb
PPPSerial0:
OCHAPSUCCESS(3)id4len4
PPPSerial0:
SendCHAPsuccessid=4toremote
PPPSerial0:
remotepassedCHAPauthentication.
PPPSerial0:
OIPCPCONFREQ
(1)id4len10
Address(6)0x10x10x10x1
PPPSerial0(i):
pkttype0x8021,datagramsize14
PPPSerial0:
IIPCPCONFREQ
(1)id4len10
Address(6)0x10x10x10x2
PPPSerial0:
input(0x8021)state=REQsentcode=CONFREQ
(1)id=4len=10
PPPSerial0:
OIPCPCONFACK
(2)id4len10
Address(6)0x10x10x10x2
PPPSerial0(i):
pkttype0x8021,datagramsize14
PPPSerial0:
IIPCPCONFACK
(2)id4len10
Address(6)0x10x10x10x1
PPPSerial0:
input(0x8021)state=ACKsentcode=CONFACK
(2)id=4len=10
PPPSerial0:
OLCPECHOREQ(9)id1len12magic0xD1500388
PPPSerial0:
echo_count2,sentid1,lineup
PPPSerial0(i):
pkttype0xC021,datagramsize16
PPPSerial0:
ILCPECHOREP(10)id1len12magic0xD15030A7
PPPSerial0:
input(0xC021)state=Opencode=ECHOREP(10)id=1len=12
PPPSerial0:
rcvdid1,sentid1,lineup
参考配置
Ra#showrunning-config!
路由器Ra的配置
Buildingconfiguration...
Currentconfiguration:
!
version6.14(9coll)
!
hostname"Ra"
!
usernameRbpassword7050B123F11
!
ipsubnet-zero
!
interfaceFastEthernet0
noipaddress
shutdown
!
interfaceFastEthernet1
noipaddress
shutdown
!
interfaceFastEthernet2
noipaddress
shutdown
!
interfaceFastEthernet3
noipaddress
shutdown
!
interfaceSerial0
ipaddress1.1.1.1255.255.255.0
encapsulationppp
pppauthenticationchap
ppppapsent-usernameRapassword71234111358
!
interfaceSerial1
noipaddress
shutdown
!
interfaceSerial2
noipaddress
shutdown
!
interfaceSerial3
noipaddress
shutdown
!
ipclassless
!
linecon0
lineaux0
linevty04
login
linevty519
login
!
end
Rb#showrunning-config!
路由器Rb的配置
Buildingconfiguration...
Currentconfiguration:
!
version6.14(9coll)
!
hostname"Rb"
!
usernameRapassword70059344251
usernameRbpassword70059344251
!
ipsubnet-zero
!
interfaceFastEthernet0
noipaddress
shutdown
!
interfaceFastEthernet1
noipaddress
shutdown
!
interfaceFastEthernet2
noipaddress
shutdown
!
interfaceFastEthernet3
noipaddress
shutdown
!
interfaceSerial0
ipaddress1.1.1.2255.255.255.0
encapsulationppp
clockrate64000
!
interfaceSerial1
noipaddress
shutdown
!
ipclassless
!
linecon0
lineaux0
linevty04
login
linevty519
login
!
end
【注意事项】
1.在DCE端配置时钟频率
2.Ra(config)#usernameRbpassword0star
!
username后面的参数是对方的主机名。
3.Rb(config)#usernameRbpassword0star
!
username后面的参数是对方的主机名。
4.在接口下封装PPP。
5.Rb#debugppppacket
!
在路由器物理层up,链路建立(?
?
?
)的情况下打开才有信息输出,本实验的实质是链路层协商建立的安全性,该信息出现在链路协商的过程中。