目录
三、CHAP认证是三次握手,密码是密文发送。(一)CHAP服务端R2配置和PPP一致,认证方式改为chap即可。
广域网中经常会使用串行链路来提供远距离的数据传输,高级链路控制HDLC(High-Level Data Link Control)和点对点协议PPP(Point to Point Protocol)是两种典型的串口封装协议。
广域网链路:二层封装PPP、HDLC、FR。
PPP可以对二层链路做认证。有两种认证方式:一是PAP认证,二是CHAP认证。
PAP认证:两次握手,明文传输;CHAP认证:三次握手,密码是密文发送。
只有串行接口(扁口)才可以更改封装方式,以太网接口不能更改封装方式,只能封装MAC地址。
一、接口地址配置
[R1]int s4/0/0
[R1-Serial4/0/0]ip address 12.1.1.1 24
[R1-Serial4/0/0]dis this
[V200R003C00]
interface Serial4/0/0
link-protocol ppp #默认的穿行接口
ip address 12.1.1.1 255.255.255.0
return
[R2]interface s4/0/0
[R2-Serial4/0/0]ip address 12.1.1.2 24
二、PAP认证
(一)服务端R2配置
[R2]aaa #标准认证方式,认证授权和审计
[R2-aaa]local-user apple password cipher 123456 #用户名apple,密码123456
Info: Add a new user.
[R2-aaa]local-user apple service-type ppp #指明服务类型PPP
[R2]int s4/0/0
[R2-Serial4/0/0]ppp authentication-mode pap #开启接口认证
shutdown 端口,然后undo shutdown检测
Jan 22 2021 21:14:16-08:00 R2 %%01PPP/4/PEERNOPAP(l)[11]:On the interface Serial
4/0/0, authentication failed and PPP link was closed because PAP was disabled on
the peer.
(二)客户端R1配置
[R1]interface s4/0/0
[R1-Serial4/0/0]ppp pap local-user apple password simple 123456
#客户端发送的用户名和密码,simple在本地显示为明文
(三)Wireshark抓包
先开启抓包,然后运行如下命令。
[R1]interface s4/0/0
[R1-Serial4/0/0]shutdown #关闭端口
[R1-Serial4/0/0]undo shutdown
三、CHAP认证是三次握手,密码是密文发送。
(一)CHAP服务端R2配置和PPP一致,认证方式改为chap即可。
[R2-Serial4/0/0]ppp authentication-mode chap
[R2-Serial4/0/0]dis this
[V200R003C00]
interface Serial4/0/0
link-protocol ppp
ppp authentication-mode chap
ip address 12.1.1.2 255.255.255.0
return
从头开始配置如下:
PPP链路是广域网链路,传输距离远,穿越运营商和外网。
[R2]aaa #标准认证方式,认证授权和审计
[R2-aaa]local-user apple password cipher 123456 #用户名apple,密码123456
Info: Add a new user.
[R2-aaa]local-user apple service-type ppp #指明服务类型PPP
[R2]int s4/0/0
[R2-Serial4/0/0]ppp authentication-mode chap #开启接口认证
(二)客户端R1配置
[R1-Serial4/0/0]undo ppp pap local-user #取消上次的配置
[R1-Serial4/0/0]ppp chap user apple #配置CHAP用户名
[R1-Serial4/0/0]ppp chap password simple 123456 #配置用户密码
[R1-Serial4/0/0]dis this
[V200R003C00]
interface Serial4/0/0
link-protocol ppp
ppp chap user apple
ppp chap password simple 123456
ip address 12.1.1.1 255.255.255.0
return
(三)验证测试
[R1-Serial4/0/0]shutdown #关闭端口
[R1-Serial4/0/0]undo shutdown #启用端口
附上截图:




四、HDLC协议
华为、H3C串行接口默认的封装方式是PPP;
思科Cisco串行默认封装的是HDLC。
[R1-Serial4/0/0]dis this
[V200R003C00]
interface Serial4/0/0
link-protocol ppp #默认的链路封装协议是PPP协议
ppp chap user apple
ppp chap password simple 123456
ip address 12.1.1.1 255.255.255.0
return
修改路由器R1和R2的链路都为HDLC
[R1-Serial4/0/0]link-protocol hdlc #修改R1链路类型为HDLC
[R2-Serial4/0/0]link-protocol hdlc #修改R2链路类型为HDLC
[R2-Serial4/0/0]dis this
[V200R003C00]
interface Serial4/0/0
link-protocol hdlc
ip address 12.1.1.2 255.255.255.0
附上截图: 


五、FR(Frame-relay)帧中继协议
FR(Frame-relay)帧中继协议不是很常用,大多被MSTP专线取代。
帧中继(frame relay)是一种面向连接的数据链路层技术。它主要用在公共或专用网上的局域网互联以及广域网连接。
(一)R1和R2设置为帧中继
[R1]interface s4/0/0
[R1-Serial4/0/0]link-protocol fr
[R1-Serial4/0/0]dis this
[V200R003C00]
interface Serial4/0/0
link-protocol fr
ip address 12.1.1.1 255.255.255.0
return
[R2]interface s4/0/0
[R2-Serial4/0/0]link-protocol fr
[R2-Serial4/0/0]dis this
[V200R003C00]
interface Serial4/0/0
link-protocol fr
ip address 12.1.1.2 255.255.255.0
return
(二)在R1路由器查看自动学习的映射表
相当于ARP的缓存表。
(三)在R2路由器S4/0/0上抓包
附上截图:
