简单组网(根据IP子网划分VLAN)

某企业拥有多个部门,如财务部、研发部、技术部等,每个部门使用的 IP 地址网段各不相同。为了便于管理,现需要将同一种部门的业务划分到同一 VLAN 中,不同类型的部门划分到不同 VLAN 中。

1、拓扑图

简要说明:

财务部属于vlan10、研发部vlan200、技术部vlan300

image

2、SWB配置

<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SWB
[SWB]vlan batch 100 200 300
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWB]int g0/0/1
[SWB-GigabitEthernet0/0/1]port link-type access
[SWB-GigabitEthernet0/0/1]port default vlan 100
[SWB-GigabitEthernet0/0/1]quit
[SWB]int g0/0/2
[SWB-GigabitEthernet0/0/2]port link-type access
[SWB-GigabitEthernet0/0/2]port default vlan 200
[SWB-GigabitEthernet0/0/2]quit
[SWB]int g0/0/3
[SWB-GigabitEthernet0/0/3]port link-type access
[SWB-GigabitEthernet0/0/3]port default vlan 300
[SWB-GigabitEthernet0/0/3]quit
[SWB]int g0/0/24
[SWB-GigabitEthernet0/0/24]port link-type trunk
[SWB-GigabitEthernet0/0/24]port trunk allow-pass vlan 100 200 300
[SWB-GigabitEthernet0/0/24]quit
[SWB]

3、SWA(配置接口,使能接口的基于IP子网划分 VLAN 功能)

<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SWA
[SWA]vlan batch 100 200 300
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA]int g0/0/1
[SWA-GigabitEthernet0/0/1]port link-type trunk
[SWA-GigabitEthernet0/0/1]port trunk allow-pass vlan 100 200 300
[SWA-GigabitEthernet0/0/1]quit
[SWA]int e0/0/1
[SWA-Ethernet0/0/1]port hybrid untagged vlan 100
[SWA-Ethernet0/0/1]ip-subnet-vlan enable
[SWA-Ethernet0/0/1]quit
[SWA]int e0/0/2
[SWA-Ethernet0/0/2]port hybrid untagged vlan 200
[SWA-Ethernet0/0/2]ip-subnet-vlan enable
[SWA-Ethernet0/0/2]quit
[SWA]int e0/0/3
[SWA-Ethernet0/0/3]port hybrid untagged vlan 300
[SWA-Ethernet0/0/3]ip-subnet-vlan enable
[SWA-Ethernet0/0/3]quit
[SWA]

4、SWA(配置基于 IP 子网划分 VLAN)

[SWA]vlan 100
[SWA-vlan100]ip-subnet-vlan 1 ip 192.168.10.2 24 priority 2
[SWA-vlan100]quit
[SWA]vlan 200
[SWA-vlan200]ip-subnet-vlan 1 ip 192.168.20.2 24 priority 3
[SWA-vlan200]quit
[SWA]vlan 300
[SWA-vlan300]ip-subnet-vlan 1 ip 192.168.30.2 24 priority 4
[SWA-vlan300]quit
[SWA]

5、查看配置效果

SWA(dis ip-subnet-vlan vlan all)

[SWA]dis ip-subnet-vlan vlan all
 ----------------------------------------------------------------
 Vlan    Index   IpAddress           SubnetMask          Priority
 ----------------------------------------------------------------
 100     1       192.168.10.2        255.255.255.0       2
 200     1       192.168.20.2        255.255.255.0       3
 300     1       192.168.30.2        255.255.255.0       4
 ----------------------------------------------------------------
 ip-subnet-vlan count: 3  		 total count: 3

[SWA]


读书和健身总有一个在路上

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文链接,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/Renqy/p/13614905.html