实验拓扑
图 1-1
注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末尾数字为 2 的设备,以此类推;另外,同一网段中,IP 地址的主机位为其设备编号,如 R3 的 g0/0 接口若在
192.168.1.0/24
网段,则其 IP 地址为192.168.1.3/24
,以此类推
实验需求
-
R1 和 R2 使用 PPP 链路直连,R2 和 R3 把 2 条 PPP 链路捆绑为 PPP MP 直连
-
按照图示配置 IP 地址
-
R2 对 R1 的 PPP 进行单向 chap 验证
-
R2 和 R3 的 PPP 进行双向 chap 验证
实验解法
-
R2 和 R3 上配置 PPP MP
步骤 1:在 R2 上创建 MP-GROUP 口
<H3C>sys System View: return to User View with Ctrl+Z. [H3C]int MP-group 1 [H3C-MP-group1]
步骤 2:把 S1/0 和 S2/0 加入到上一步创建的 MP-GROUP口
[H3C-MP-group1]int s1/0 [H3C-Serial1/0]ppp mp MP-group 1
[H3C-Serial1/0]int s2/0 [H3C-Serial2/0]ppp mp MP-group 1
步骤 3:R3 上配置命令与 R2 一致,
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]int MP-group 1
[H3C-MP-group1]int s1/0
[H3C-Serial1/0]ppp mp MP-group 1
[H3C-Serial1/0]int s2/0
[H3C-Serial2/0]ppp mp MP-group 1
-
按照图示配置 IP 地址
分析:如果 PPP 链路上配置了 PPP-MP,那么链路的 IP 地址就必须配置在 MP-GROUP 口上,而不是物理口上
步骤 1:R1 和 R2 ,R3的直连链路 IP 地址配置
R1
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn rt1
[rt1]int s1/0
[rt1-Serial1/0]ip add 192.168.1.1 24
[rt1-Serial1/0]
R2
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysn rt2
[rt2]int s3/0
[rt2-Serial3/0]ip add 192.168.1.2 24
步骤 2:在 R2 和 R3 的 MP-GROUP 口上配置 IP 地址
[rt2-Serial2/0]interface MP-group 1
[rt2-MP-group1]ip address 192.168.2.2 24
This subnet overlaps with another interface!
[rt2-MP-group1]
[rt3]interface MP-group 1
[rt3-MP-group1]ip address 192.168.2.3 24
This subnet overlaps with another interface!
[rt3-MP-group1]
-
R2 对 R1 的 PPP 进行单向 chap 验证
分析:R2 对 R1 进行单向验证,表示 R2 是主验证方,R1 是被验证方。所以需要在 R2 上创建用于验证的用户
步骤 1:在 R2 上创建用于验证 R1 的用户[rt2]local-user user1 class network New local user added. [rt2-luser-network-user1]password simple 123 [rt2-luser-network-user1]service-type ppp [rt2-luser-network-user1]
步骤 2:在 R2 连接 R1 的接口上配置需要进行 PPP 验证,验证方式为 chap
[rt2-luser-network-user1]int s3/0 [rt2-Serial3/0]ppp authentication-mode chap [rt2-Serial3/0]
步骤 3:在 R1 连接 R2 的接口上配置用于验证的用户名和密码
[rt1-Serial1/0]int s1/0 [rt1-Serial1/0]ppp chap user user1 [rt1-Serial1/0]ppp chap password simple 123 [rt1-Serial1/0]
步骤 4:关闭在开启 R1 和 R2 的 PPP 链路,检查验证是否能够通过,这里需要重启端口才会开启验证。
[rt2-Serial3/0]shutdown
[rt2-Serial3/0]undo shutdown
步骤 5:我们吧Rt1的用户删除后发现不通了,再次添加既可恢复,都需要关闭在开启端口才能生效
[rt1-Serial1/0]undo ppp chap user [rt1-Serial1/0]shutdown [rt1-Serial1/0]undo shu [rt1-Serial1/0]undo shutdown [rt1-Serial1/0]ping 192.168.1.2
%Apr 18 10:25:10:249 2022 rt1 IFNET/3/PHY_UPDOWN: Physical state on the interface Serial1/0 changed to up. ping 192.168.1.2 Ping 192.168.1.2 (192.168.1.2): 56 data bytes, press CTRL_C to break Request time out Request time out Request time out Request time out Request time out
[rt1-Serial1/0]ppp chap user user1 [rt1-Serial1/0]undo shu [rt1-Serial1/0]undo shutdown [rt1-Serial1/0]ping 192.168.1.2
Ping 192.168.1.2 (192.168.1.2): 56 data bytes, press CTRL_C to break 56 bytes from 192.168.1.2: icmp_seq=0 ttl=255 time=0.000 ms 56 bytes from 192.168.1.2: icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from 192.168.1.2: icmp_seq=2 ttl=255 time=0.000 ms 56 bytes from 192.168.1.2: icmp_seq=3 ttl=255 time=0.000 ms 56 bytes from 192.168.1.2: icmp_seq=4 ttl=255 time=1.000 ms
-
R2 和 R3 的 PPP 进行双向 chap 验证
分析:双向验证意味着 R2 和 R3 双方都需要创建用于验证的用户,且需要在各自接口上配置对端的用户名
另外,虽然R2 和 R3 之间的 PPP 链路配置了 PPP-MP,但是身份验证仍然需要配置在物理接口上,所以 R2 和 R3 相连的所有 PPP 接口上都需要配置验证
步骤 1:在 R2 和 R3上创建用户验证 R3 的用户[rt2-Serial3/0]local-user user2 class network New local user added. [rt2-luser-network-user2]password simple 123 [rt2-luser-network-user2]service-type ppp
[rt3]local-user user2 class network New local user added. [rt3-luser-network-user2]password simple 123 [rt3-luser-network-user2]service-type ppp [rt3-luser-network-user2]
步骤 2:在 R2 和 R3 相连的接口上配置需要进行 PPP 验证,验证方式为 chap,并配置对端验证本端的用户名
[rt2-luser-network-user2]int s1/0 [rt2-Serial1/0]ppp authentication-mode chap [rt2-Serial1/0]ppp chap user user2 [rt2-Serial1/0]
[rt2-Serial1/0]int s2/0 [rt2-Serial2/0]ppp authentication-mode chap [rt2-Serial2/0]ppp chap user user2 [rt2-Serial2/0]
[rt3-luser-network-user2]int s1/0 [rt3-Serial1/0]ppp authentication-mode chap [rt3-Serial1/0]ppp chap user user2 [rt3-Serial1/0]
[rt3-Serial1/0]int s2/0 [rt3-Serial2/0]ppp authentication-mode chap [rt3-Serial2/0]ppp chap user user2 [rt3-Serial2/0]
步骤 4:关闭在开启 R2 和 R3 的 PPP 链路,检查验证是否能够通过
RT3
[rt3-Serial1/0]int s1/0
[rt3-Serial1/0]shutdown
[rt3-Serial1/0]undo shutdown
[rt3-Serial1/0]int s2/0
[rt3-Serial1/0]shutdown
[rt3-Serial1/0]undo shutdown
Rt2
[rt2-Serial1/0]int s1/0
[rt2-Serial1/0]shutdown
[rt2-Serial1/0]undo shutdown
[rt2-Serial1/0]int s2/0
[rt2-Serial1/0]shutdown
[rt2-Serial1/0]undo shutdown
测试能ping
[rt2-Serial2/0]ping 192.168.2.3
Ping 192.168.2.3 (192.168.2.3): 56 data bytes, press CTRL_C to break 56 bytes from 192.168.2.3: icmp_seq=0 ttl=255 time=1.000 ms 56 bytes from 192.168.2.3: icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from 192.168.2.3: icmp_seq=2 ttl=255 time=1.000 ms 56 bytes from 192.168.2.3: icmp_seq=3 ttl=255 time=0.000 ms 56 bytes from 192.168.2.3: icmp_seq=4 ttl=255 time=0.000 ms
注:这里也可以在rt2与Rt3中删除一条串口线,不影响通讯