华为交换机配置VLAN间路由
发布网友
发布时间:2022-09-16 06:39
我来回答
共1个回答
热心网友
时间:2023-10-12 11:03
VLAN技术是把一个物理的LAN在逻辑上划分成多个广播域,VLAN内的主机可以直接通信,VLAN间的主机无法互通。如此,广播报文就被*在一个VLAN内,同时也提高了网络安全性。VLAN id 取值 0~4095,可配置值为0~4094,0和4095为保留值。
Access接口是用来连接主机或终端的接口。
同一网段内,划分了不同VLAN,VLAN间是无法进行通信的。
VLAN间路由
实验拓扑
主机配置
SW2
#
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW2
[SW2]vlan 10
[SW2-vlan10]description R&D //给VLAN打标签(如研发部门R&D)
[SW2-vlan10]vlan 20
[SW2-vlan20]description Market
[SW2-vlan20]quit
[SW2]inter e0/0/2
[SW2-Ethernet0/0/2]port link-type access
[SW2-Ethernet0/0/2]port default vlan 10
[SW2-Ethernet0/0/2]quit
[SW2]interface e0/0/3
[SW2-Ethernet0/0/3]port link-type access
[SW2-Ethernet0/0/3]port default vlan 20
[SW2-Ethernet0/0/3]inter e0/0/1
[SW2-Ethernet0/0/1]port link-type trunk
[SW2-Ethernet0/0/1]port trunk allow-pass vlan 10 20
#
SW3
#
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW3s
[SW3s]sys SW3
[SW3]vlan 10
[SW3-vlan10]dest
[SW3-vlan10]desc
[SW3-vlan10]description R@D
[SW3-vlan10]vlan 20
[SW3-vlan20]desc
[SW3-vlan20]description market
[SW3-vlan20]description Market
[SW3-vlan20]quit
[SW3]inter e0/0/2
[SW3-Ethernet0/0/2]port link-type access
[SW3-Ethernet0/0/2]port default vlan 10
[SW3-Ethernet0/0/2]inter e0/0/3
[SW3-Ethernet0/0/3]port link-type access
[SW3-Ethernet0/0/3]port default vlan 20
[SW3-Ethernet0/0/3]inter e0/0/1
[SW3-Ethernet0/0/1]port link-type trunk
[SW3-Ethernet0/0/1]port trunk all
[SW3-Ethernet0/0/1]port trunk allow-pass vlan 10 20
[SW3-Ethernet0/0/1]quit
#
SW1
#
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW1
[SW1]vlan 10
[SW1-vlan10]description R&D
[SW1-vlan10]vlan 20
[SW1-vlan20]description Market
[SW1-vlan20]quit
[SW1]inter g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk-all
[SW1-GigabitEthernet0/0/1]port trunk all
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/1]quit
[SW1]inter g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk all
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/2]
#
配置完成,ping测试一下