码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-05-08 10:20:52      阅读:910      评论:0      收藏:0      [点我收藏+]

标签:交换机和trunkacces

技术分享图片
如图所示:
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
<Huawei>undo terminal monitor #关闭提示信息
Info: Current terminal monitor is off.
<Huawei>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
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>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
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>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

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

标签:交换机和trunkacces

原文地址:http://blog.51cto.com/13721773/2113815

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!