预配置: 第一步:R1上的预配置 R1(config)#int s1/2 R1(config-if)#ip add 10.1.1.1 255.255.255.0 R1(config-if)#encapsulation ppp R1(config-if)ppp authentication chap R1(config-if)#no sh 第二步:R2的预配置 R2(config)#int s2/1 R2(config-if)#ip add 12.1.1.2 255.255.255.0 R2(config-if)#en R2(config-if)#encapsulation ppp
R2(config-if)ppp authentication chap
R2(config-if)#no sh 实验过程: 第一步:在R1上配置用户名与密码和CHAP认证 R1(config)# **R1(config)#username R2 password bbb ** R1(config)#int s1/2 R1(config-if)#ppp authentication chap R1(config-if)# 第二步:在R2上配置用户名与密码和CHAP认证 R2(config)#username R1 password bbb R2(config)#int s2/1 R2(config-if)#ppp authentication chap R2(config-if)# 第三步:在R1上调试PPP CHAP认证过程 R1#debug ppp authentication PPP authentication debugging is on R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int s1/2 R1(config-if)#sh R1(config-if)# R1(config-if)# 00:07:23: %LINK-5-CHANGED: Interface Serial1/2, changed state to administratively down 00:07:24: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to down R1(config-if)#no sh R1(config-if)# 00:07:29: %LINK-3-UPDOWN: Interface Serial1/2, changed state to up R1(config-if)# 00:07:29: Se1/2 PPP: Treating connection as a dedicated line 00:07:29: Se1/2 PPP: Phase is AUTHENTICATING, by both 00:07:29: Se1/2 CHAP: O CHALLENGE id 2 len 23 from "R1" 00:07:29: Se1/2 CHAP: I CHALLENGE id 3 len 23 from "R2" 00:07:29: Se1/2 CHAP: O RESPONSE id 3 len 23 from "R1" 00:07:29: Se1/2 CHAP: I RESPONSE id 2 len 23 from "R2" 00:07:29: Se1/2 CHAP: O SUCCESS id 2 len 4 00:07:29: Se1/2 CHAP: I SUCCESS id 3 len 4  (通过认证) R1(config-if)# 00:07:30: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to up R1(config-if)#