首先配置PAP身份验证:

如图

155201442.png

R1的配置:

R1#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#username R2 password 123

R1(config)#interface serial 0/0

R1(config-if)#encapsulation ppp

R1(config-if)#ppp quality 80   //l链路质量

R1(config-if)#ppp multilink    //负载均衡

R1(config-if)#ip add 192.168.1.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#ppp authentication pap

R1(config-if)#ppp pap sent-username R1 password 123

R1(config-if)#

R2的配置:

R2#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#username R1 password 123

R2(config)#interface serial 0/0

R2(config-if)#encapsulation ppp

R2(config-if)#ppp quality 80

R2(config-if)#ppp multilink

R2(config-if)#ip add 192.168.1.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#ppp authentication pap

R2(config-if)#ppp pap sent-username R2 password 123

R2(config-if)#

在R2上开启debug ppp authentication

关闭R2 然后再开启R2进行 PAP验证过程的查看:

160209478.png

我们在用抓包软件进行分析:

160634981.png

可以看到明文密码,说明 PAP验证并不安全。


接下来我们配置一下CHAP身份验证:

161309871.png

R1的配置:

R1#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#username R2 password 123

R1(config)#interface serial 0/0

R1(config-if)#encapsulation ppp

R1(config-if)#ip add 172.16.12.1 255.255.255.0

R1(config-if)#ppp authentication chap

R1(config-if)#no shutdown

R2的配置:

R2#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#username R1 password 123

R2(config)#interface serial 0/0

R2(config-if)#encapsulation ppp

R2(config-if)#ip add 172.16.12.2 255.255.255.0

R2(config-if)#ppp authentication chap

R2(config-if)#no shutdown


同样开启R2的debug ppp authentication

对R2 的s0/0端口进行关闭然后开启进行chap验证过程的查看:

161922641.png

参看抓到的chap包:

162027411.png

由此可见chap的密码是加密的,安全性要远远高于pap。