实验目的:实现不同VLAN,不同网段,pc互通
IP地址及网关:
PC1:192.168.1.1/24 GW:1.254 PC4:192.168.3.1/24 GW:3.254
PC2:192.168.2.1/24 GW:2.254 PC5:192.168.4.1/24 GW:4.254
PC3:192.168.5.1/24 GW:5.254 PC6:192.168.5.2/24 GW:5.254
实验拓扑图如下:
交换机之间用trunk
交换机和pc之间用access
SW1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW1
[SW1]vlan 10
[SW1-vlan10]q
[SW1]vlan 20
[SW1-vlan20]q
[SW1]vlan 30
[SW1-vlan30]q
[SW1]vlan 40
[SW1-vlan40]q
[SW1]vlan 50
[SW1-vlan50]q
[SW1]int vlanif 10
[SW1-Vlanif10]ip add 192.168.1.254 24
[SW1-Vlanif10]int vlanif 20
[SW1-Vlanif20]ip add 192.168.2.254 24
[SW1-Vlanif20]int vlanif 30
[SW1-Vlanif30]ip add 192.168.3.254 24
[SW1-Vlanif30]int vlanif 40
[SW1-Vlanif40]ip add 192.168.4.254 24
[SW1-Vlanif40]int vlanif 50
[SW1-Vlanif50]ip add 192.168.5.254 24
[SW1-Vlanif50]q
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default vlan 50
[SW1-GigabitEthernet0/0/3]int g0/0/4
[SW1-GigabitEthernet0/0/4]port link-type trunk
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan all
SW2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW1
[SW1]vlan 10 //创建VLAN
[SW1-vlan10]q
[SW1]vlan 20
[SW1-vlan20]q
[SW1]vlan 30
[SW1-vlan30]q
[SW1]vlan 40
[SW1-vlan40]q
[SW1]vlan 50
[SW1-vlan50]q
[SW1]int vlanif 10
[SW1-Vlanif10]ip add 192.168.1.254 24
[SW1-Vlanif10]int vlanif 20
[SW1-Vlanif20]ip add 192.168.2.254 24
[SW1-Vlanif20]int vlanif 30
[SW1-Vlanif30]ip add 192.168.3.254 24
[SW1-Vlanif30]int vlanif 40
[SW1-Vlanif40]ip add 192.168.4.254 24
[SW1-Vlanif40]int vlanif 50
[SW1-Vlanif50]ip add 192.168.5.254 24
[SW1-Vlanif50]q
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/1]port default vlan 30
[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 40
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]port link-type access
[SW2-GigabitEthernet0/0/3]port default vlan 50
[SW2-GigabitEthernet0/0/3]int g0/0/4
[SW2-GigabitEthernet0/0/4]port link-type trunk
[SW2-GigabitEthernet0/0/4]port trunk allow-pass vlan all
PC互相ping:
用PC1ping通PC2
用PC1ping同PC5和PC6:
关闭日志的配置
undo info-center enable
文章来源地址https://www.toymoban.com/news/detail-512515.html
文章来源:https://www.toymoban.com/news/detail-512515.html
到了这里,关于华为ensp不同vlan不同网段之间互通的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!