有一网络拓扑图如上
要求:PC间互通
思路:配置所有端口、设备IP后配置静态路由实现互通
配置:
①如图配置PC和端口IP
AR1:
[Huawei-GigabitEthernet0/0/1]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.2/24 up up
GigabitEthernet0/0/1 12.1.1.1/30 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
AR2:
[Huawei]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.2/30 up up
GigabitEthernet0/0/1 23.1.1.1/30 up up
GigabitEthernet0/0/2 192.168.2.2/24 up up
NULL0 unassigned up up(s)
AR3:
[Huawei]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 23.1.1.2/30 up up
GigabitEthernet0/0/1 192.168.3.2/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
②配置静态路由
AR1:
[Huawei]ip route-static 23.1.1.0 30 12.1.1.2
[Huawei]ip route-static 192.168.2.0 24 12.1.1.2
[Huawei]ip route-static 192.168.3.0 24 12.1.1.2
AR2:
[Huawei]ip route-static 192.168.3.0 24 23.1.1.2
[Huawei]ip route-static 192.168.1.0 24 12.1.1.1
AR3:
[Huawei]ip route-static 12.1.1.0 30 23.1.1.1
[Huawei]ip route-static 192.168.2.0 24 23.1.1.1
[Huawei]ip route-static 192.168.1.0 24 23.1.1.1
测试:
进入PC1,pingPC2
PC>ping 192.168.2.1
Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
From 192.168.2.1: bytes=32 seq=3 ttl=126 time=15 ms
From 192.168.2.1: bytes=32 seq=4 ttl=126 time=32 ms
From 192.168.2.1: bytes=32 seq=5 ttl=126 time=15 ms--- 192.168.2.1 ping statistics ---
5 packet(s) transmitted
3 packet(s) received
40.00% packet loss
round-trip min/avg/max = 0/20/32 ms
进入PC1,pingPC3
PC>ping 192.168.3.1
Ping 192.168.3.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
From 192.168.3.1: bytes=32 seq=3 ttl=126 time=31 ms
From 192.168.3.1: bytes=32 seq=4 ttl=126 time=32 ms
From 192.168.3.1: bytes=32 seq=5 ttl=126 time=16 ms--- 192.168.3.1 ping statistics ---
5 packet(s) transmitted
3 packet(s) received
40.00% packet loss
round-trip min/avg/max = 0/16/32 ms
进入PC2,pingPC3
PC>ping 192.168.3.1
Ping 192.168.3.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
From 192.168.3.1: bytes=32 seq=3 ttl=126 time=16 ms
From 192.168.3.1: bytes=32 seq=4 ttl=126 time=31 ms
From 192.168.3.1: bytes=32 seq=5 ttl=126 time=15 ms--- 192.168.3.1 ping statistics ---
5 packet(s) transmitted
3 packet(s) received
40.00% packet loss
round-trip min/avg/max = 0/15/16 ms