HuaWei ❀ 基于IP子网划分VLAN

基于IP子网划分VLAN

某企业拥有多种业务,如IPTV、VoIP、Internet等,每种业务使用的IP地址网段各不相同,为了便于管理,现在需要将同一种类型业务划分到同一个VLAN中;
在这里插入图片描述

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

接口加入VLAN:
[sw1]int g0/0/4
[sw1-GigabitEthernet0/0/4]port hybrid untagged vlan 10
[sw1-GigabitEthernet0/0/4]ip-subnet-vlan enable
[sw1-GigabitEthernet0/0/4]quit

[sw1]int g0/0/5
[sw1-GigabitEthernet0/0/5]port hybrid untagged vlan 20
[sw1-GigabitEthernet0/0/5]ip-subnet-vlan enable
[sw1-GigabitEthernet0/0/5]quit

[sw1]int g0/0/6
[sw1-GigabitEthernet0/0/6]port hybrid untagged vlan 30
[sw1-GigabitEthernet0/0/6]ip-subnet-vlan enable
[sw1-GigabitEthernet0/0/6]quit

配置Trunk:
[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

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

配置VLAN 10与192.168.1.2/24关联,优先级为2(0-7):
[sw1]vlan 10
[sw1-vlan10]ip-subnet-vlan 1 ip 192.168.1.2 24 priority 2
序号 子网掩码 优先级
[sw1-vlan10]quit

[sw1]vlan 20
[sw1-vlan20]ip-subnet-vlan 1 ip 192.168.2.2 24 priority 3
[sw1-vlan20]quit

[sw1]vlan 3
[sw1-vlan30]ip-subnet-vlan 1 ip 192.168.3.2 24 priority 4
[sw1-vlan30]quit

查看IP子网绑定VLAN信息:
[sw1]display ip-subnet-vlan vlan all
/ ----------------------------------------------------------------
Vlan Index IpAddress SubnetMask Priority
/----------------------------------------------------------------
10 1 192.168.1.2 255.255.255.0 2
20 1 192.168.2.2 255.255.255.0 3
30 1 192.168.3.2 255.255.255.0 4
/ ----------------------------------------------------------------
ip-subnet-vlan count: 3 total count: 3

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页