华为交换机配置VLAN间路由
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为交换机配置VLAN间路由相关的知识,希望对你有一定的参考价值。
参考技术A 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测试一下
以上是关于华为交换机配置VLAN间路由的主要内容,如果未能解决你的问题,请参考以下文章