華為eNSP多層交換機不同vlan之間的通信
阿新 • • 發佈:2018-05-08
交換機和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
如圖所示:
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]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]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 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之間的通信