华为HCNA之PPP认证实验

导语:

PPP:点到点协议,数据链路层封装技术,公有协议HDLC的升级版
两种认证方式:PAP,CHAP
PAP(Password Authentication Protocol)用户名和密码使用明文传输,安全性低。
CHAP(Challenge Handshake Authentication Protocol)用户名和密码使用密文传输,安全性较高。

拓扑图:

在这里插入图片描述

步骤:

1.基本配置:

如拓扑图和配置图所示,完成各个物理设备和接口的配置,并测试连通性:
在这里插入图片描述

2.搭建OSPF网络:

这里仅以R1为例,R2、R3同理:

[R1]ospf
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.13.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255

配置完成后,测试PC-1 和PC-2的连通性:
在这里插入图片描述
通信正常。

3.配置PPP的PAP认证:

为了提升分部和总部通信的安全性,在R1和R3之间配置PAP认证,R3为认证路由,R1为被认证路由:

[R3]interface Serial 4/0/0
[R3-Serial4/0/0]ppp authentication-mode pap domain  huawei

[R3]aaa
[R3-aaa]authentication-scheme huawei
Info: Create a new authentication scheme.
[R3-aaa-authen-huawei]authentication-mode local 

[R3-aaa]domain huaweiyu
Info: Success to create a new domain.
[R3-aaa-domain-huaweiyu]authorization-scheme huawei

[R3-aaa]local-user R1@huaweiyu password cipher huawei
Info: Add a new user.
[R3-aaa]local-user R1@huaweiyu service-type ppp

配置完成后,关闭R1和R3相连的端口一段时间后再打开,使得R1和R3重新协商链路状态:

[R3]interface Serial 4/0/0
[R3-Serial4/0/0]shutdown 
[R3-Serial4/0/0]undo shutdown 

此时检查链路状态和连通性:
在这里插入图片描述
可以观察到,R1和R3无法正常通信,他们链路物理状态正常,而链路协议不正常,这是因为PAP认证未通过,因为只配置了认证方R3,还未配置被认证方R1:

[R1]interface Serial 4/0/0
[R1-Serial4/0/0]ppp pap local-user R1@huaweiyu password cipher huawei

查看R1的链路状态:
在这里插入图片描述
在这里插入图片描述
可以看到,R1和R3的链路状态正常,通信正常;
测试PC-1和PC-2的连通性:
在这里插入图片描述
通信正常。

4.配置PPP的CHAP认证:

由于PAP认证的用户名和密码是以明文的方式在链路上传输的,因此不安全,而CHAP采用md5的密文传输方式能够提高链路安全性:

首先删除原有的PAP认证配置,域名不变:

[R3]interface Serial 4/0/0
[R3-Serial4/0/0]undo ppp authentication-mode

[R1]interface Serial 4/0/0
[R1-Serial4/0/0]undo ppp pap local-user 

然后配置为CHAP:

[R3-Serial4/0/0]ppp authentication-mode chap
[R3-Serial4/0/0]quit
[R3]aaa
[R3-aaa]local-user R1 password cipher huawei
Info: Add a new user.
[R3-aaa]local-user R1 service-type ppp

其余保持不变;
配置完成后,关闭接口一段时间再打开,使链路状态重新协商:

[R3-Serial4/0/0]shutdown 
[R3-Serial4/0/0]undo shutdown 
[R1-Serial4/0/0]ppp chap user R1
[R1-Serial4/0/0]ppp chap password cipher huawei

测试R1和R3的连通性:
在这里插入图片描述
测试PC-1和PC-2的连通性:
在这里插入图片描述
通信正常!

至此,PPP认证实验已经完成!

思考题:

问题:当PPP链路Up后,在PPP链路一端加上认证配置而另一端不加,为什么一定要重启端口后认证才能生效使双方不能正常通信?
解答:PPP认证的协商在发生在PPP会话建立阶段,当PPP会话成功建立后PPP链路将一直保持通信,不再更改协商的参数直至关闭这条链路的连接。只有关闭连接后重新建立会话时才重新协商参数,认证方式的更改才能生效。

猜你喜欢

转载自blog.csdn.net/qq_37176318/article/details/106891411