当前位置:文档之家› 华为交换机静态路由配置

华为交换机静态路由配置

华为交换机静态路由配置 The latest revision on November 22, 2020
一、实验拓扑图:
二、配置:
LSW1:
interface Vlanif2
ip address
#
interface Vlanif3
ip address
#
interface Vlanif4
ip address
#
interface MEth0/0/1
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
port link-type access
port default vlan 2
#
interface Ethernet0/0/10
port link-type access
port default vlan 3
LSW2:
interface Vlanif2
ip address
#
interface Vlanif4
ip address
#
interface MEth0/0/1
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094 #
interface Ethernet0/0/2
port link-type access
port default vlan 2
三、测试:
1.配置好上面的命令好以后:
和之间能互ping通,但是与之间互ping不通:
2.在LSW1配置:ip route-static
在LSW2配置:
ip route-static
ip route-static
就能测试正常:
3.把两台交换机的 interface ethernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
改为: interface ethernet 0/0/1
port link-type access
port default vlan 4
测试的结果也是正常ping通的。

四、收集信息:
在两台交换机创建相同的VLAN,分配不同的网段,之间用trunk链路,同台交换机的不同网段可以互相ping通,不同的交换机之间是ping不通,可以做安全,只需要通过路由协议就能互通。

五、查看路由表:
1.。

相关主题