赞
踩
PPP协议即点对点协议,是在点对点连接上传输多协议数据包提供了一个标准方法,是一种点到点的串行通信协议。PPP协议提供认证的功能,一种是pap另一种是chap,相对来说,pap认证方式安全性没有chap认证高,pap传输密码是明文的,经过两次握手实现,而chap不传输密码,是经过三次握手实现的。
命令格式 | 含义 |
---|---|
encapsulation PPP | 封装指定协议 |
ppp authentication chap | 指定PPP用户认证方式 |
username 对方路由器名 password 对方路由器密码 | 记录对方路由器名和密码 |
ppp pap sent-username 路由器名 password 密码 | 设置向对方发送的pap认证信息 |
1.掌握不带PPP协议的配置
2.学会带有pap认证的PPP协议配置
3.学会带有chap认证的PPP协议配置
配置路由器0
Router>enable Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int g0/0 Router(config-if)#ip address 192.168.1.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)# %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up Router(config-if)#exit Router(config)#int Ser0/3/0 Router(config-if)#ip address 192.168.3.1 255.255.255.0 Router(config-if)#clock rate 72000 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#route rip Router(config-router)#version 2 Router(config-router)#network 192.168.1.0 Router(config-router)#network 192.168.3.0
配置路由器1
Router>enable Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int Ser0/3/0 Router(config-if)#ip address 192.168.3.2 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#int g0/0 Router(config-if)#ip address 192.168.2.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#route rip Router(config-router)#version 2 Router(config-router)#network 192.168.3.0 Router(config-router)#network 192.168.2.0 Router(config-router)#end
这里使用主机PC0ping主机PC1
C:\>ping 192.168.2.11
Pinging 192.168.2.11 with 32 bytes of data:
Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=1ms TTL=126
Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=2ms TTL=126
Ping statistics for 192.168.2.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 3ms, Average = 2ms
C:\>
这里是可以直接连通的,因为默认封装了HDLC协议
Router#show int s0/3/0
Serial0/3/0 is up, line protocol is up (connected)
Hardware is HD64570
Internet address is 192.168.3.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
但是HDLC协议兼容性不好
封装带pap认证的PPP协议
路由器0
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3/0, changed state to down
Router(config-if)#ppp pap sent-username route001 password 123456
Router(config-if)#exit
Router(config)#username route002 password 123456
路由器1
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3/0, changed state to up
Router(config-if)#ppp pap sent-username route002 password 123456
Router(config-if)#exit
Router(config)#username route001 password 12345
查看一下协议,看出已经是封装了PPP协议
Router#show int s0/3/0
Serial0/3/0 is up, line protocol is up (connected)
Hardware is HD64570
Internet address is 192.168.3.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, loopback not set, keepalive set (10 sec)
封装带chap认证的PPP协议
路由器0
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#enable secret 123456
Router(config)#username route002 password 123456
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#ppp authentication chap
路由器1
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#enable secret 123456
Router(config)#username route001 password 123456
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#ppp authentication chap
Router(config-if)#
C:\>ping 192.168.2.11
Pinging 192.168.2.11 with 32 bytes of data:
Reply from 192.168.2.11: bytes=32 time=1ms TTL=126
Reply from 192.168.2.11: bytes=32 time=4ms TTL=126
Reply from 192.168.2.11: bytes=32 time=1ms TTL=126
Reply from 192.168.2.11: bytes=32 time=1ms TTL=126
Ping statistics for 192.168.2.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 4ms, Average = 1ms
C:\
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。