华为ENSP-实验拓扑** 附件**:—>三层交换机互联-路由设置.zip
次种方式互联是否需要添加路由取决于pc6.100的网关设置
网关:6.254,sw2需要添加路由
网关:6.253,则不需要添加路由
可根据tracert 172.16.1.100看出(有截图)
sw1 sw2 不加路由:1.100-6.253 v
1.100-6.254 x
6.100-6.253 v
6.100-1.254 x
sw2 路由 172.16.1.0/24 172.16.6.253(对段IP)
或者 0.0.0.0/0 172.16.6.253
1.100-6.253 v
1.100-6.254 v
6.100-6.253 v
6.100-1.254 v
[sw1]dis ip routing-table
Destination/Mask Proto Pre Cost Flags NextHop Interface
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
172.16.1.0/24 Direct 0 0 D 172.16.1.254 Vlanif10
172.16.1.254/32 Direct 0 0 D 127.0.0.1 Vlanif10
172.16.6.0/24 Direct 0 0 D 172.16.6.253 Vlanif60
172.16.6.253/32 Direct 0 0 D 127.0.0.1 Vlanif60
[[sw1]
················································································
[sw2]dis ip routing-table
Destination/Mask Proto Pre Cost Flags NextHop Interface
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
172.16.1.0/24 Static 60 0 RD 172.16.6.253 Vlanif60
172.16.6.0/24 Direct 0 0 D 172.16.6.254 Vlanif60
172.16.6.254/32 Direct 0 0 D 127.0.0.1 Vlanif60
[sw2]
················································································
pc2 网关:172.16.6.254 需要路由
PC2>tracert 172.16.1.100
traceroute to 172.16.1.100, 8 hops max
(ICMP), press Ctrl+C to stop
1 172.16.6.254 31 ms 16 ms 31 ms
2 172.16.6.253 31 ms 47 ms 47 ms
3 172.16.1.100 62 ms 63 ms 78 ms
PC2>
················································································
pc2 网关:172.16.6.253 不需要路由
PC2>tracert 172.16.1.100
traceroute to 172.16.1.100, 8 hops max
(ICMP), press Ctrl+C to stop
1 172.16.6.253 31 ms 47 ms 47 ms
2 172.16.1.100 94 ms 62 ms 63 ms
PC2>