DTE:数据终端设备(自己买的设备是DTE

DCE: 数据电路终接设备(运营商送的是 DCE
配置PAP认证
PPP认证为PAP和CHAP两种
1、主认证端DCE 的PAP配置   ; 在主认证端添加被认证用户的用户名和密码
R1(config)#username R1 password 0 123  (password 参数后面的0表示密码是为文明保存的
R1(config)#interface s0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0  (配置S0/0的接口IP)
R1(config-if)#encapsulation ppp   (把S0/0封装PPP协议)
R1(config-if)#ppp authentication pap    (启动认证PAP协议)
R1(config-if)#clock rate 64000   (配置DCE接口的时钟)
R1(config-if)#no shutdown
2,被认证端DTE 的PAP配置
R2(config)#interface s0/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0  (配置IP地址)
R2(config-if)#encapsulation ppp  (SO/0封装PPP协议)
R2(config-if)#ppp pap sent-username R1 password 0 123 (发起用户密码认证;在被认证端配置的用户名和密码必须和与在主认证端配置的用户名和密码相同)
R2(config-if)#no shutdown
-------------------------------------------
配置CHAP认证
服务器配置R1
R1(config)#username R2 password 0 123  配置用户名和密码(用户名为对方的用户名,也可以随便一个不同的名,必须是唯一的,密码必须和被认证方的是一样的密码)
R1(config)#interface s0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0  (配置接口IP地址)
R1(config-if)#encapsulation ppp   (封装PPP协议在S0/0接口)
R1(config-if)#clock rate 64000    (DCE接口方配置时钟,只能在DCE方配置,其他方不可以)
R1(config-if)#ppp authentication chap (启动CHAP协议,直接翻译为PPP认证CHAP协议)
R1(config-if)#no shutdown

客服端R2
R2(config)#username R1 password 0 123 (配置用户名和密码,用户名为对方的或随便一个不同的名必须是唯一,密码必须和服务器端一样的)
R2(config)#interface s0/0
R2(config-if)#ip addres 192.168.1.2 255.255.255.0 (配置S0/0接口的IP地址)
R2(config-if)#encapsulation ppp    (封装PPP协议在S0/0接口)
R2(config-if)#ppp authentication chap(启动CHAP协议,双方必须都启动CHAP协议)
R2(config-if)#no shutdown
R2#ping 192.168.1.1
---------------
查看PPP的配置
router#show interface serial 0/1
internet address will be negotiated using IPCP:接口的IP地址是通过IPCP协议协商的
LCP Open:LCP协议的状态为Open,协议工作正常
Open:IPCP,CDPCP状态为Open,协议工作正常
调试命令
router#debug PPP packet