国庆学不停,PPP认证实验你了解了没
本次实验拓扑如下,用的是思科的EVEng:

配置如下:
R1(config)#int s1/0
R1(config-if)#encapsulation ppp
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R2(config)#int s1/1
R2(config-if)#en
R2(config-if)#encapsulation ppp
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
到这里我们验证一下配置结果:show interfaces s1/0

(1)当前是使用的 PPP 协议,LCP 状态已经 open, 使用的 I*** CD***,在单向认证,R1 为主认证方,R2 为被认证方。
R1(config)#username admin password cisco //设置本地认证数据库的用户名和密码
R1(config)#int s1/0
R1(config-if)#ppp authentication pap //在接口声明启用 PAP 认证
R1(config-if)#
*Aug 26 06:59:22.228: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to down
R1(config-if)#shutdown
R1(config-if)#no shutdown
接口 shutdown 再no shutdown 也不能 UPUP 现在接口是 down 的 因为协商还不够,因为 R2 没有出示用户名密码 认证需要完成,数据链路层才能起来。 那我们来看一下接口状态:show ip int brief

被认证方需要在接口出示 PAP 用户名密码。
R2(config)#int s1/1
R2(config-if)#ppp pap sent-username admin password cisco
R1 是和我本地配置的匹配,成功即可通过,接口才能 UP UP。这时我们再来查看一下R1和R2的互联接口的状态。


然后我们再通过互ping来测试一下接口的连通性:

ping通了!!
(2)双向认证,R2 也作为主认证方, R1 为被认证方。
R2(config)#username ABC password 123
R2(config)#int s1/1
R2(config-if)#ppp authentication pap

使用 CHAP
R1(config)#int s1/0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#ex
R1(config)#username R2 password cisco
*Aug 26 07:29:34.622: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to up
R2(config)#int s1/1
R2(config-if)#encapsulation ppp
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R1(config-if)#ex
R2(config)#username R1 password cisco

在让 R2 做主认证方


因为匹配的是 username R1 password cisco,R1 接口没有配置任何参数,默认发送的是 R1,
可以匹配到,所以能够 ping 通。我们在接口配置用户名密码:


发现链路会 down,

但是在出示密码前,链路就 UPUP,使用的密码还是全局配置的密码,全局高于接口。
太阁的祝福会迟到但不会缺席!太阁网络学院祝大家双节快乐!
