目录
功能介绍
PPP是广域网链路的一种封装形式,相比较于HDLC,PPP更常用。
一、组网需求
两台设备,通过同步接口(serial口),封装PPP,启用PPP认证,这里指定RSR-A为认证服务端,RSR-B为认证客户端;
二、组网拓扑
三、配置要点
1、进入接口,将接口封装为PPP帧模式;
2、配置IP地址;
3、配置CHAP认证 或者 配置 PAP认证 (可选);
四、配置步骤
1、进入接口,将接口封装为PPP帧模式;
注意,两端封装模式必须一致,同为PPP或同为HDLC。
RSR-A(config)#interface Serial 3/1/0
RSR-A (config-if - Serial 3/1/0)# encapsulation PPP //封装为PPP
RSR-B(config)#interface Serial 3/1/0
RSR-B (config-if - Serial 3/1/0)# encapsulation PPP //封装为PPP
2、配置IP地址;
RSR-A(config-if -Serial 3/1/0)#ip address 172.16.1.1 255.255.255.252 //配置IP
RSR-B(config-if -Serial 3/1/0)#ip address 172.16.1.2 255.255.255.252 //配置IP
PPP封装的接口,两端地址可以不在同一个网段;在L2TP/PPTP等VPN应用中,两端地址可能就不在一个网段;在实际的点到点广域网链路中,一般会配置为一个网段;
3、配置CHAP认证 或者 配置 PAP认证 (可选);
1)PPP认证可以加强线路的安全性,是否启用认证不影响通信;是否启用可根据实际部署选择
2)一般,一条PPP链路的认证,只要一端为认证服务端,一段为认证客户端;一般不需进行双向认证
3)下面例子中,以RSR-A为认证服务端,RSR-B为认证客户端
CHAP认证配置:
认证服务端配置:
RSR-A (config-if - Serial 3/1/0)# ppp authentication chap //启用链路chap认证
RSR-A(config)#username ruijie password 123 //创建帐号,用于客户端chap认证拨入;也可以通过AAA来进行帐号管理,AAA的配置参考”AAA“章节(参考:典型配置--->安全--->AAA)
认证客户端配置:
RSR-B (config-if - Serial 3/1/0)#ppp chap hostname ruijie //CHAP认证用户名
RSR-B (config-if - Serial 3/1/0)# ppp chap password 123 //CHAP认证密码
用户名密码需要和对端设备的本地或AAA帐号一致;注意,后面不要敲空格。
PAP认证配置:
认证服务端配置:
RSR-A (config-if - Serial 3/1/0)# ppp authentication PAP //启用链路PAP认证
RSR-A(config)#username ruijie password 123 //创建帐号,用于客户端chap认证拨入;也可以通过AAA来进行帐号管理,AAA的配置参考”AAA“章节(参考:典型配置--->安全--->AAA)
认证客户端配置:
RSR-B (config-if - Serial 3/1/0)#ppp pap sent-username ruijie password 0 123 //PAP认证用户名密码
用户名密码需要和对端设备的本地或AAA帐号一致;注意,后面不要敲空格。
五、配置验证
1、通过show interface serial 3/1/0 具体接口,确认接口协商状态。物理和协议都up说明协商OK。
RSR-A#sho interfaces serial 3/1/0
Index(dec):62 (hex):3e
Serial 3/1/0:0 is UP , line protocol is UP
Hardware is Serial
2、通过ping测试链路是否联通
RSR-A#ping 172.16.1.2
Sending 5, 100-byte ICMP Echoes to 172.16.1.2, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms