[SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
在SwitchB配置两条IP静态路由。
1 2
[SwitchB] ip route-static 10.1.1.0 255.255.255.0 10.1.4.1 [SwitchB] ip route-static 10.1.3.0 255.255.255.0 10.1.4.6
在SwitchC配置IP缺省路由。
1
[SwitchC] ip route-static 0.0.0.0 0.0.0.0 10.1.4.5
5、验证配置结果
查看SwitchA的IP路由表。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[SwitchA] display ip routing-table Route Flags: R - relay, D - download to fib, T - to vpn-instance ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 7 Routes : 7 Destination/Mask Proto Pre Cost Flags NextHop Interface 0.0.0.0/0 Static 60 0 RD 10.1.4.2 Vlanif10 10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif30 10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif30 10.1.4.0/30 Direct 0 0 D 10.1.4.1 Vlanif10 10.1.4.1/32 Direct 0 0 D 127.0.0.1 Vlanif10 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
使用ping命令验证连通性。
1 2 3 4 5 6 7 8 9 10 11 12 13
[SwitchA] ping 10.1.3.1 PING 10.1.3.1: 56 data bytes, press CTRL_C to break Reply from 10.1.3.1: bytes=56 Sequence=1 ttl=253 time=62 ms Reply from 10.1.3.1: bytes=56 Sequence=2 ttl=253 time=63 ms Reply from 10.1.3.1: bytes=56 Sequence=3 ttl=253 time=63 ms Reply from 10.1.3.1: bytes=56 Sequence=4 ttl=253 time=62 ms Reply from 10.1.3.1: bytes=56 Sequence=5 ttl=253 time=62 ms
--- 10.1.3.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 62/62/63 ms
使用Tracert命令验证连通性。
1 2 3 4
[SwitchA] tracert 10.1.3.1 traceroute to 10.1.3.1(10.1.3.1), max hops: 30 ,packet length: 40,press CTRL_C to break 1 10.1.4.2 31 ms 32 ms 31 ms 2 10.1.3.1 62 ms 63 ms 62 ms