簡單組網(根據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]


讀書和健身總有一個在路上


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM