首先我们应当先搭建好拓扑模型,拓扑图如下:
首先进入配置模式
<Huawei>sy
<Huawei>system-view
为ar1路由器上的端口配置ip
[Huawei]interface g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 24
interface g0/0/1
[1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
为ar2路由器上的端口配置ip
[2]interface g0/0/1
[2-GigabitEthernet0/0/1]ip address 192.168.2.2 24
[2]interface g0/0/0
[2-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[2]interface g0/0/2
[2-GigabitEthernet0/0/2]ip address 192.168.4.1 24
为ar3路由器上的端口配置ip
[3]interface g0/0/1
[3-GigabitEthernet0/0/1]ip address 192.168.4.2 24
[3]interface g0/0/0
[3-GigabitEthernet0/0/0]ip address 192.168.5.1 24
静态路径
pc1连接pc2的方法
[1]IP route-static 192.168.3.0 24 192.168.2.2
[2]ip route-static 192.168.1.0 24 192.168.2.1
pc1连接pc3的方法
[1]ip route-static 192.168.5.0 24 192.168.4.1
[3]ip route-static 192.168.1.0 24 192.168.2.2
pc2连接pc3的方法
[2]ip route-static 192.168.5.0 24 192.168.4.2
[3]ip route-static 192.168.3.0 24 192.168.4.1
pc1
pc2
pc3
结果
pc1去ping pc2和pc3
pc2去ping pc1和pc3
pc3去ping pc2和pc1