CHAP和PAP的配置
PPP的认证方式:PAP认证和CHAP认证。
PAP认证是简单的认证方式,是2次交互就能够正常的认证。
CHAP认证比PAP认证复杂,是3次得交互方式。
配置PPP认证chap模式
hostname cisco1
username cisco2 password 0 cisco 先配置要进行验证的对端路由器的名字和密码
ip subnet-zero
!
interface Serial0/1
ip address 1.1.1.1 255.255.255.252
encapsulation ppp 配置接口的封装模式为PPP
serial restart-delay 0
ppp authentication chap 配置认证的模式为chap
!
对端的配置:
hostname cisco2
!
username cisco1 password 0 cisco
!
interface Serial0/1
ip address 1.1.1.2 255.255.255.252
encapsulation ppp
serial restart-delay 0
ppp authentication chap
debug ppp authentication 通过debug信息查看的信息
#
00:25:09: Se0/1 PPP: Using default call direction
00:25:09: Se0/1 PPP: Treating connection as a dedicated line
00:25:09: Se0/1 CHAP: Using alternate hostname cisco1
00:25:09: Se0/1 CHAP: O CHALLENGE id 176 len 27 from "cisco1"
00:25:09: Se0/1 CHAP: I CHALLENGE id 179 len 27 from "cisco2"
00:25:09: Se0/1 CHAP: I RESPONSE id 176 len 27 from "cisco2"
00:25:09: Se0/1 CHAP: Using alternate hostname cisco1
00:25:09: Se0/1 CHAP: O RESPONSE id 179 len 27 from "cisco1"
00:25:09: Se0/1 CHAP: O SUCCESS id 176 len 4
00:25:09: Se0/1 CHAP: I SUCCESS id 179 len 4
PPP配置pap模式:
hostname r1
username r2 password 0 cisco 配置接入的用户和密码
ip subnet-zero
!
interface Serial0/1
ip address 1.1.1.1 255.255.255.252
encapsulation ppp 封装成PPP
serial restart-delay 0
ppp authentication pap PPP的认证方式是PAP
ppp pap sent-username r1 password 0 cisco 配置发送给对端的账号和密码
对端的配置:
hostname r2
username r1 password 0 cisco
ip subnet-zero
!
interface Serial0/1
ip address 1.1.1.2 255.255.255.252
encapsulation ppp
serial restart-delay 0
ppp authentication pap
ppp pap sent-username r2 password 0 cisco
!
调试信息:
r1(config-if)#
01:09:25: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up
01:09:25: Se0/1 PPP: Using default call direction
01:09:25: Se0/1 PPP: Treating connection as a dedicated line
01:09:25: Se0/1 PAP: O AUTH-REQ id 41 len 13 from "r1"
01:09:26: Se0/1 PAP: I AUTH-REQ id 41 len 13 from "r2"
01:09:26: Se0/1 PAP: I AUTH-ACK id 41 len 5
01:09:26: Se0/1 PAP: Authenticating peer r2
01:09:26: Se0/1 PAP: O AUTH-ACK id 41 len 5