华为eNSP多层交换机不同vlan之间的通信

华为eNSP多层交换机不同vlan之间的通信_第1张图片如图所示:
PC1的IP地址192.168.10.1,vlan 10 网关192.168.10.254
PC2的IP地址192.168.20.1,vlan 20 网关192.168.20.254
PC3的IP地址192.168.30.1,vlan 30 网关192.168.30.254
PC4的IP地址192.168.40.1,vlan 40 网关192.168.40.254
PC5的ip地址192.168.50.1,vlan 50 网关192.168.50.254
LSW5
undo terminal monitor #关闭提示信息
Info: Current terminal monitor is off.
sys #进入系统视图
[Huawei]vlan batch 10 20 30 #连续创建vlan 10 20 30
[Huawei]int vlan 10 #进入vlan 10
[Huawei-Vlanif10]ip add 192.168.10.254 24 #配置vlan 10的网关地址
[Huawei-Vlanif10]int vlanif 20 #进入vlan 20
[Huawei-Vlanif20]ip add 192.168.20.254 24 #配置vlan 20的网关地址
[Huawei-Vlanif20]int vlanif 30 #进入vlan 30
[Huawei-Vlanif30]ip add 192.168.30.254 24 #配置vlan 30的网关地址
[Huawei-Vlanif30]q #退出vlan 30的配置界面
[Huawei]int g0/0/2 #进入端口视图
[Huawei-GigabitEthernet0/0/2]port link-type access #将端口设置为access模式
[Huawei-GigabitEthernet0/0/2]port default vlan 10 #将端口加入到vlan 10
[Huawei-GigabitEthernet0/0/2]q #退出端口视图
[Huawei]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 20
[Huawei-GigabitEthernet0/0/3]q
[Huawei]int g0/0/4
[Huawei-GigabitEthernet0/0/4]port link-type access
[Huawei-GigabitEthernet0/0/4]port default vlan 30
[Huawei-GigabitEthernet0/0/4]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]q
LSW4
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 10 20 30 40 50
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int vlanif 10
[Huawei-Vlanif10]ip add 192.168.10.254 24
[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip add 192.168.20.254 24
[Huawei-Vlanif20]int vlanif 30
[Huawei-Vlanif30]ip add 192.168.30.254 24
[Huawei-Vlanif30]int vlanif 40
[Huawei-Vlanif40]ip add 192.168.40.254 24
[Huawei-Vlanif40]int vlanif 50
[Huawei-Vlanif50]ip add 192.168.50.254 24
[Huawei-Vlanif50]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/2]q
LSW6
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 40 50
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int vlanif 40
[Huawei-Vlanif40]ip add 192.168.40.254 24
[Huawei-Vlanif40]int vlanif 50
[Huawei-Vlanif50]ip add 192.168.50.254 24
[Huawei-Vlanif50]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 40
[Huawei-GigabitEthernet0/0/2]q
[Huawei]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 50
[Huawei-GigabitEthernet0/0/3]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]q
验证:5台主机互通,用PC1 ping192.168.20.1/192.168.30.1/192.168.40.1/192.168.50.1

©著作权归作者所有:来自51CTO博客作者ntdjingcai的原创作品,如需转载,请注明出处,否则将追究法律责任

你可能感兴趣的:(华为eNSP多层交换机不同vlan之间的通信)