HuaWei ❀ 基于协议划分VLAN

基于协议划分VLAN

某企业拥有多种业务,如IPTV、VoIP、Internet等,每种业务使用的协议不同,为了便于管理,现在需要将同一种类型业务划分到同一个VLAN中,不同类型的业务划分到不同的VLAN中;
HuaWei ❀ 基于协议划分VLAN

创建VLAN:
[sw1]vlan batch 10 20
[sw2]vlan batch 10 20

配置协议关联VLAN:
[sw2]vlan 10
[sw2-vlan10]protocol-vlan ?
INTEGER<0-15> Protocol index
at AT(AppleTalk Protocol) configuration information
ipv4 IPv4 configuration information
ipv6 IPv6 configuration information
ipx IPX(Internetwork Packet eXchange) configuration information
mode Other protocol mode configuration information
[sw2-vlan10]protocol-vlan ipv4
[sw2-vlan10]quit

[sw2]vlan 20
[sw2-vlan20]protocol-vlan ipv6
[sw2-vlan20]quit

配置接口关联协议VLAN:
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]protocol-vlan vlan 10 ?
INTEGER<0-15> Protocol index
all All the protocols of the VLAN

[sw2-GigabitEthernet0/0/1]protocol-vlan vlan 10 all priority ?
INTEGER<0-7> The priority ID

[sw2-GigabitEthernet0/0/1]protocol-vlan vlan 10 all priority 5
[sw2-GigabitEthernet0/0/1]quit

配置接口划入对应VLAN、配置Trunk:
[sw2]int g0/0/3
[sw2-GigabitEthernet0/0/3]port link-type trunk
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
[sw2-GigabitEthernet0/0/3]quit

[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type access
[sw2-GigabitEthernet0/0/1]port default vlan 10
[sw2-GigabitEthernet0/0/1]quit

[sw2]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type access
[sw2-GigabitEthernet0/0/2]port default vlan 20
[sw2-GigabitEthernet0/0/2]quit

[sw1]int g0/0/3
[sw1-GigabitEthernet0/0/3]port link-type trunk
[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
[sw1-GigabitEthernet0/0/3]quit

[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[sw1-GigabitEthernet0/0/1]quit

[sw1]int g0/0/2
[sw1-GigabitEthernet0/0/2]port link-type trunk
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[sw1-GigabitEthernet0/0/2]quit

查看配置结果:
[sw2]display protocol-vlan interface all
/-------------------------------------------------------------------------------
Interface VLAN Index Protocol Type Priority
/-------------------------------------------------------------------------------
GigabitEthernet0/0/1 10 0 IPv4 5
GigabitEthernet0/0/2 20 0 IPv6 6

上一篇:华为-OSPF协议的虚链路


下一篇:朱晔的互联网架构实践心得S2E4:小议微服务的各种玩法(古典、SOA、传统、K8S、ServiceMesh)