拓扑结构如图所示。图中R2连接了两个网络,通过串行链路点到点接口连接到192.168.123.0/24和192.168.124.0/24。最终要实现的效果是要求R1与R3进行通信。
在R1上的配置:
[Huawei]interface s0/0/0
[Huawei-Serial0/0/0]ip address 192.168.123.1 24
在R2上的配置:
[Huawei]interface s0/0/0
[Huawei-Serial0/0/0]ip address 192.168.123.2 24
[Huawei-Serial0/0/1]ip address 192.168.124.1 24
在R3上的配置:
[Huawei]interface s0/0/0
[Huawei-Serial0/0/0]ip address 192.168.124.2 24
在R3上测试一下直连路由的连通性:
[Huawei]ping 192.168.124.1
PING 192.168.124.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.124.1: bytes=56 Sequence=1 ttl=255 time=10 ms
Reply from 192.168.124.1: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.124.1: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 192.168.124.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.124.1: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 192.168.124.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/32/50 ms
接下来在R1和R3上配置:
[Huawei]ip route-static 192.168.124.0 24 s0/0/0
[Huawei]ip route-static 192.168.123.0 24 s0/0/0
测试R1到R3的连通性:
[Huawei]ping 192.168.124.2
PING 192.168.124.2: 56 data bytes, press CTRL_C to break
Reply from 192.168.124.2: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 192.168.124.2: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 192.168.124.2: bytes=56 Sequence=3 ttl=254 time=80 ms
Reply from 192.168.124.2: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 192.168.124.2: bytes=56 Sequence=5 ttl=254 time=50 ms
--- 192.168.124.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/50/80 ms
配置完毕。