初始:配置各路由器的IP地址。
  Router(config)#host r1
  r1(config)#int s1/0
  r1(config-if)#clock rate 64000
  r1(config-if)#ip address 10.1.1.1 255.255.255.0
  r1(config-if)#no sh
  Router(config)#host r2
  r2(config)#int s1/0
  r2(config-if)#ip address 10.1.1.2 255.255.255.0
  r2(config-if)#clock rate 64000
  r2(config-if)#no sh
  I:配置PAP单向身份验证
  r1(config)#username r2 password 123 /验证方建立数据库
  r1(config)#int s1/0
  r1(config-if)#encapsulation ppp /进行PPP封装
  r1(config-if)#ppp authentication pap /使用PAP实现PPP的验证
  r2(config)#int s1/0
  r2(config-if)#encapsulation ppp
  r2(config-if)#ppp pap sent-username r2 password 123 /发送验证信息
  测试结果:
  r1#ping 10.1.1.2
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 4/9/16 ms
II:配置PAP双向身份验证
  r1(config)#username r2 password 123
  r1(config)#int s1/0
  r1(config-if)#encapsulation ppp
  r1(config-if)#ppp authentication pap
  r1(config-if)#ppp pap sent-username r1 password 321 /注意此时发送的password
  r2(config)#username r1 password 321
  r2(config)#int s1/0
  r2(config-if)#encapsulation ppp
  r2(config-if)#ppp authentication pap
  r2(config-if)#ppp pap sent-username r2 password 123 /注意此时发送的password
  测试结果:
  r1#ping 10.1.1.2
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/16 ms
  III:配置CHAP单向的身份验证.
  r1(config)#username r2 password 123
  r1(config)#int s1/0
  r1(config-if)#encapsulation ppp
  r1(config-if)#ppp authentication chap
  r2(config)#int s1/0
  r2(config-if)# encapsulation ppp
  r2(config-if)#ppp chap hostname r2
  r2(config-if)#ppp chap password 123
  测试结果:
  r2#ping 10.1.1.1
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 8/18/36 ms
  IV:配置CHAP双向的身份验证.
  r1(config)#username r2 password 123
  r1(config)#int s1/0
  r1(config-if)# encapsulation ppp
  r1(config-if)# ppp authentication chap
  r2(config-if)#username r1 password 123
  r2(config)#int s1/0
  r2(config-if)# encapsulation ppp
  r2(config-if)# ppp authentication chap
  测试结果:
  r2#ping 10.1.1.1
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 8/18/36 ms