拓扑结构(全网可达):
配置:
ar1:
进入第三级配置ip;
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.2.1 24
[r1]ip route-static 192.168.3.0 24 192.168.2.2
[r1]ip route-static 192.168.4.0 24 192.168.2.2
[r1]ip route-static 192.168.5.0 24 192.168.2.2
ar2:
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.2 24
[r2]int g 0/0/2
[r2-GigabitEthernet0/0/2]ip add 192.168.3.1 24
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.4.1 24
[r2]ip route-static 192.168.1.0 24 192.168.2.1
[r2]ip route-static 192.168.5.0 24 192.168.4.2
ar3:
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.4.2 24
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.5.1 24
[r3]ip route-static 192.168.2.0 24 192.168.4.1
[r3]ip route-static 192.168.3.0 24 192.168.4.1
[r3]ip route-static 192.168.1.0 24 192.168.4.1
pc1 -ipv4基本配置
pc2 - ipv4基本配置
pc3 -ipv4 基本配置
测试是否连通:pc1pingpc2,pc3
pc2 ping pc1, pc3
pc3 ping pc1,pc3