前一篇文章涵盖了接入层、汇聚层、核心层,相对于本次实验多了一个核心层,对于有基础的同学可以去尝试一下
总得来说,只要逻辑清晰,做起来还是不困难的。那我们话不多说,直接开始速通
一、先看拓扑图
二、 把思路理清
二层POE交换有什么作用?三层汇聚层有什么作用?AC又有什么作用?我们理清楚之后就可以开始敲代码了,建议自己写脚本,然后直接去刷代码即可,这样效率更高。
1、二层POE交换机
二层交换机功能:存储转发、vlan隔离、身份
1.划分vlan
2.接口处理
3.管理vlan是身份ip配置(ip、子网掩码、网关)
4.MSTP配置
[Huawei]vlan ba 20 30 40 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]
[Huawei]int vlan 40
[Huawei-Vlanif40]ip add 192.168.40.40 24
[Huawei-Vlanif40]quit
[Huawei]ip route-static 0.0.0.0 0.0.0.0 10.254.40.254
[Huawei]
[Huawei]int g0/0/3
[Huawei-GigabitEthernet0/0/3]po li t
[Huawei-GigabitEthernet0/0/3]po t pv vlan 2
[Huawei-GigabitEthernet0/0/3]po t all vlan all
[Huawei-GigabitEthernet0/0/3]
[Huawei-GigabitEthernet0/0/3]int g0/0/4
[Huawei-GigabitEthernet0/0/4]po li t
[Huawei-GigabitEthernet0/0/4]po t pv vlan 3
[Huawei-GigabitEthernet0/0/4]po t all vlan all
[Huawei-GigabitEthernet0/0/4]
[Huawei-GigabitEthernet0/0/4]int g0/0/1
[Huawei-GigabitEthernet0/0/1]po li t
[Huawei-GigabitEthernet0/0/1]po t all vlan all
Jan 12 2025 17:12:04-08:00 Huawei %%01IFNET/4/IF_STATE(l)[55]:Interface Vlanif40
has turned into UP state.
Jan 12 2025 17:12:04-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[56]:The line protoco
l IP on the interface Vlanif40 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]po li t
[Huawei-GigabitEthernet0/0/2]po t all vlan all
[Huawei-GigabitEthernet0/0/2]
[Huawei-GigabitEthernet0/0/2]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name hc
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 2 20
[Huawei-mst-region]instance 2 vlan 3 30 40
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-mst-region]
[Huawei-mst-region]stp instance 1 root secondary
[Huawei]stp instance 2 root secondary
2、三层AC
三层设备AC的功能:路由转发、路由、AC管理、身份
1、接口处理(路由口、唯一身份)
2、多区域ospf配置
3、AP管理配置
3.1 AP上线
3.2 AP参数
[AC6005]vlan ba 5 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[AC6005]int loo 0
[AC6005-LoopBack0]ip add 1.1.1.1 32
[AC6005-LoopBack0]int vlan 5
[AC6005-Vlanif5]ip add 192.168.5.1 30
[AC6005-Vlanif5]int vlan 6
[AC6005-Vlanif6]ip add 192.168.6.1 30
[AC6005-Vlanif6]int g0/0/1
[AC6005-GigabitEthernet0/0/1]po li ac
[AC6005-GigabitEthernet0/0/1]po def vlan 5
[AC6005-GigabitEthernet0/0/1]int g0/0/2
[AC6005-GigabitEthernet0/0/2]po li ac
[AC6005-GigabitEthernet0/0/2]po def vlan 6
[AC6005-GigabitEthernet0/0/2]ospf 1 router-id 1.1.1.1
[AC6005-ospf-1] area 0.0.0.0
[AC6005-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.3
[AC6005-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.3
[AC6005-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[AC6005]vlan pool admin
[AC6005-vlan-pool-admin]vlan 20 30
[AC6005-vlan-pool-admin]q
//下面的无线部分
[AC6005]wlan
[AC6005-wlan-view]ssi
[AC6005-wlan-view]ssid-profile na
[AC6005-wlan-view]ssid-profile name zhz
[AC6005-wlan-ssid-prof-zhz]ss
[AC6005-wlan-ssid-prof-zhz]q
[AC6005-wlan-view]ssid-profile name admin
[AC6005-wlan-ssid-prof-admin]ss
[AC6005-wlan-ssid-prof-admin]ssid admin
Info: This operation may take a few seconds, please wait.done.
[AC6005-wlan-ssid-prof-admin]q
[AC6005-wlan-view]vap-profile name admin
[AC6005-wlan-vap-prof-admin]forward-mode direct-forward
[AC6005-wlan-vap-prof-admin]service-vlan vlan-pool admin
Info: This operation may take a few seconds, please wait.done.
[AC6005-wlan-vap-prof-admin]ssid-profile admin
Info: This operation may take a few seconds, please wait.done.
[AC6005-wlan-vap-prof-admin]q
[AC6005-wlan-view]ap-group name admin
Info: This operation may take a few seconds. Please wait for a moment.done.
[AC6005-wlan-ap-group-admin]vap-profile admin wlan 1 radio all
Info: This operation may take a few seconds, please wait...done.
[AC6005-wlan-ap-group-admin]q
[AC6005-wlan-view]ap-mac 00e0-fca6-1840
[AC6005-wlan-ap-0]ap-group admin
Warning: This operation may cause AP reset. If the country code changes, it will
clear channel, power and antenna gain configurations of the radio, Whether to c
ontinue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[AC6005-wlan-ap-0]q
[AC6005-wlan-view]ap-m
[AC6005-wlan-view]ap-mac 00e0-fc67-25f0
[AC6005-wlan-ap-1]ap-group admin
Warning: This operation may cause AP reset. If the country code changes, it will
clear channel, power and antenna gain configurations of the radio, Whether to c
ontinue? [Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment.. done.
[AC6005-wlan-ap-1]q
[AC6005-wlan-view]security-profile name admin
[AC6005-wlan-sec-prof-admin]security wpa-wpa2 psk pass-phrase password aes
Warning: The current password is too simple. For the sake of security, you are a
dvised to set a password containing at least two of the following: lowercase let
ters a to z, uppercase letters A to Z, digits, and special characters. Continue?
[Y/N]:y
[AC6005-wlan-sec-prof-admin]q
[AC6005-wlan-view]vap-profile name admin
[AC6005-wlan-vap-prof-admin]security-profile admin
Warning: This action may cause service interruption. Continue?[Y/N]y
Info: This operation may take a few seconds, please wait...done.
[AC6005-wlan-vap-prof-admin]q
[AC6005-wlan-view]q
[AC6005]capwap source ip-address 1.1.1.1
[AC6005]
3、三层汇聚层
三层汇聚交换机功能:存储转发、vlan隔离、身份、网关、路由
1、接口处理
2、划分vlan
3、管理vlan的主或备网关配置(ip、子网掩码、虚拟网关、优先级、抢占)
4、APvlan的主或备网关配置(ip、子网掩码、虚拟网关、优先级、抢占)
5、用户vlan的主或备网关配置(ip、子网掩码、虚拟网关、优先级、抢占)
6、MSTP配置
7、DHCP配置
LSW1
[Huawei]vlan ba 2 3 20 30 40 5
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int gi 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-t acc
[Huawei-GigabitEthernet0/0/1]port def vlan 5
[Huawei-GigabitEthernet0/0/1]int vlan 5
[Huawei-Vlanif5]ip add 192.168.5.2 30
[Huawei-Vlanif5]int gi 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-t trunk
[Huawei-GigabitEthernet0/0/2]port trunk al vl all
[Huawei-GigabitEthernet0/0/2]int eth 10
[Huawei-Eth-Trunk10]
Jan 12 2025 17:24:44-08:00 Huawei %%01IFNET/4/IF_STATE(l)[0]:Interface Vlanif5 h
as turned into UP state.
Jan 12 2025 17:24:44-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface Vlanif5 has entered the UP state.trun gi 0/0/23
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]trun gi 0/0/24
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]port link-t trunk
[Huawei-Eth-Trunk10]port trunk al vl all
[Huawei-Eth-Trunk10]int vlan 2
[Huawei-Vlanif2]ip add 192.168.2.252 24
[Huawei-Vlanif2]vrrp vrid 1 virtual-ip 192.168.2.254
[Huawei-Vlanif2]vrrp vrid 1 priority 120
[Huawei-Vlanif2]vrrp vrid 1 preempt-mode timer delay 30
[Huawei-Vlanif2]int vlan 20
[Huawei-Vlanif20]ip add 192.168.20.252 24
[Huawei-Vlanif20]vrrp vrid 1 virtual-ip 192.168.20.254
[Huawei-Vlanif20]vrrp vrid 1 priority 120
[Huawei-Vlanif20]vrrp vrid 1 preempt-mode timer delay 30
[Huawei-Vlanif20]int vlan 3
[Huawei-Vlanif3]ip add 192.168.3.252 24
[Huawei-Vlanif3]vrrp vrid 1 virtual-ip 192.168.3.254
[Huawei-Vlanif3]int vlan 30
[Huawei-Vlanif30]ip add 192.168.30.252 24
[Huawei-Vlanif30]vrrp vrid 1 virtual-ip 192.168.30.254
[Huawei-Vlanif30]int vlan 40
[Huawei-Vlanif40]ip add 192.168.40.252 24
[Huawei-Vlanif40]vrrp vrid 1 virtual-ip 192.168.40.254
[Huawei-Vlanif40]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name hc
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 2 20
[Huawei-mst-region]instance 2 vlan 3 30 40
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-mst-region]stp instance 1 root primary
Jan 12 2025 17:24:44-08:00 Huawei %%01IFNET/4/IF_STATE(l)[2]:Interface Eth-Trunk
10 has turned into UP state.
[Huawei]stp instance 2 root secondary
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool vlan2
Info:It's successful to create an IP address pool.
[Huawei-ip-pool-vlan2]network 192.168.2.0 mas 24
[Huawei-ip-pool-vlan2]gate 192.168.2.254
[Huawei-ip-pool-vlan2]option 43 sub-option 3 ascii 1.1.1.1
[Huawei-ip-pool-vlan2]ip pool vlan20
Info:It's successful to create an IP address pool.
[Huawei-ip-pool-vlan20]network 192.168.20.0 mas 24
[Huawei-ip-pool-vlan20]gate 192.168.20.254
[Huawei-ip-pool-vlan20]dns 8.8.8.8
[Huawei-ip-pool-vlan20]int vlan 2
[Huawei-Vlanif2]dhcp select gl
[Huawei-Vlanif2]int vlan 20
[Huawei-Vlanif20]dhcp select gl
[Huawei-Vlanif20]int loopback 0
[Huawei-LoopBack0]ip add 2.2.2.2 32
[Huawei-LoopBack0]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1] area 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0] network 192.168.5.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
Jan 12 2025 17:24:44-08:00 Huawei %%01IFNET/4/IF_STATE(l)[3]:Interface Vlanif2 h
as turned into UP state.
Jan 12 2025 17:24:44-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[4]:The line protocol
IP on the interface Vlanif2 has entered the UP state.
[Huawei-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei-ospf-1]q
[Huawei]
LSW2
[Huawei]vlan ba 2 3 20 30 40 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]
[Huawei]int gi 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-t acc
[Huawei-GigabitEthernet0/0/1]port def vlan 6
[Huawei-GigabitEthernet0/0/1]int vlan 6
[Huawei-Vlanif6]ip add 192.168.6.2 30
[Huawei-Vlanif6]int gi 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-t trunk
[Huawei-GigabitEthernet0/0/2]port trunk al vl all
Jan 12 2025 17:28:35-08:00 Huawei %%01IFNET/4/IF_STATE(l)[0]:Interface Vlanif6 h
as turned into UP state.
Jan 12 2025 17:28:35-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface Vlanif6 has entered the UP state.
[Huawei-GigabitEthernet0/0/2]int eth 10
[Huawei-Eth-Trunk10]trun gi 0/0/23
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]trun gi 0/0/24
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk10]port link-t trunk
[Huawei-Eth-Trunk10]port trunk al vl all
[Huawei-Eth-Trunk10]int vlan 2
[Huawei-Vlanif2]ip add 192.168.2.253 24
[Huawei-Vlanif2]vrrp vrid 1 virtual-ip 192.168.2.254
[Huawei-Vlanif2]int vlan 20
[Huawei-Vlanif20]ip add 192.168.20.253 24
[Huawei-Vlanif20]vrrp vrid 1 virtual-ip 192.168.20.254
[Huawei-Vlanif20]int vlan 3
[Huawei-Vlanif3]ip add 192.168.3.253 24
[Huawei-Vlanif3]vrrp vrid 1 virtual-ip 192.168.3.254
[Huawei-Vlanif3]vrrp vrid 1 priority 120
[Huawei-Vlanif3]vrrp vrid 1 preempt-mode timer delay 30
[Huawei-Vlanif3]int vlan 30
[Huawei-Vlanif30]ip add 192.168.30.253 24
[Huawei-Vlanif30]vrrp vrid 1 virtual-ip 192.168.30.254
[Huawei-Vlanif30]vrrp vrid 1 priority 120
[Huawei-Vlanif30]vrrp vrid 1 preempt-mode timer delay 30
[Huawei-Vlanif30]int vlan 40
[Huawei-Vlanif40]ip add 192.168.40.253 24
[Huawei-Vlanif40]vrrp vrid 1 virtual-ip 192.168.40.254
[Huawei-Vlanif40]vrrp vrid 1 priority 120
[Huawei-Vlanif40]vrrp vrid 1 preempt-mode timer delay 30
[Huawei-Vlanif40]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name hc
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 2 20
[Huawei-mst-region]instance 2 vlan 3 30 40
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-mst-region]stp instance 2 root primary
[Huawei]stp instance 1 root secondary
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool vlan3
Info:It's successful to create an IP address pool.
[Huawei-ip-pool-vlan3]network 192.168.3.0 mas 24
[Huawei-ip-pool-vlan3]gate 192.168.3.254
[Huawei-ip-pool-vlan3]option 43 sub-option 3 ascii 1.1.1.1
[Huawei-ip-pool-vlan3]ip pool vlan30
Info:It's successful to create an IP address pool.
[Huawei-ip-pool-vlan30]network 192.168.30.0 mas 24
[Huawei-ip-pool-vlan30]gate 192.168.30.254
[Huawei-ip-pool-vlan30]dns 8.8.8.8
[Huawei-ip-pool-vlan30]int vlan 3
[Huawei-Vlanif3]dhcp select gl
[Huawei-Vlanif3]int vlan 30
[Huawei-Vlanif30]dhcp select gl
[Huawei-Vlanif30]int loopback 0
[Huawei-LoopBack0]ip add 3.3.3.3 32
[Huawei-LoopBack0]ospf 1 router-id 3.3.3.3
Jan 12 2025 17:28:35-08:00 Huawei %%01IFNET/4/IF_STATE(l)[2]:Interface Eth-Trunk
10 has turned into UP state.
[Huawei-ospf-1] area 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0] network 192.168.6.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
Jan 12 2025 17:28:35-08:00 Huawei %%01IFNET/4/IF_STATE(l)[3]:Interface Vlanif2 h
as turned into UP state.
Jan 12 2025 17:28:35-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[4]:The line protocol
IP on the interface Vlanif2 has entered the UP state.
[Huawei-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.40.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei-ospf-1]q
[Huawei]
到这里已经将有线和无线的命令均配置完成
4、测试
这里已经显示出现流量覆盖区域(只要出现圈,那你这个实验就没有问题了)
如果圈的颜色是一层蓝色的,说明您少敲了一个,这边建议用all更加方便,而且还不容易出错
[AC6005-wlan-ap-group-admin]vap-profile admin wlan 1 radio ?
INTEGER<0-2> Radio ID
all All
使用“dis vrrp brief”命令显示当前设备上配置的VRRP的简要信息
<Huawei>dis vrrp b
VRID State Interface Type Virtual IP
----------------------------------------------------------------
1 Master Vlanif2 Normal 192.168.2.254
1 Master Vlanif20 Normal 192.168.20.254
1 Backup Vlanif3 Normal 192.168.3.254
1 Backup Vlanif30 Normal 192.168.30.254
1 Backup Vlanif40 Normal 192.168.40.254
----------------------------------------------------------------
Total:5 Master:2 Backup:3 Non-active:0
使用 “dis stp brief” 命令显示当前设备上STP的简要状态信息
<Huawei>dis stp b
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING NONE
0 GigabitEthernet0/0/2 ROOT FORWARDING NONE
0 Eth-Trunk10 ALTE DISCARDING NONE
1 GigabitEthernet0/0/2 DESI FORWARDING NONE
1 Eth-Trunk10 DESI FORWARDING NONE
2 GigabitEthernet0/0/2 DESI FORWARDING NONE
2 Eth-Trunk10 ROOT FORWARDING NONE
使用“dis ap all” 命令显示所有接入点(AP)的详细信息
<AC6005>dis ap all
Info: This operation may take a few seconds. Please wait for a moment.done.
Total AP information:
nor : normal [2]
--------------------------------------------------------------------------------
-------------------
ID MAC Name Group IP Type State STA
Uptime
--------------------------------------------------------------------------------
-------------------
0 00e0-fca6-1840 00e0-fca6-1840 admin 192.168.2.253 AP6050DN nor 1
14M:9S
1 00e0-fc67-25f0 00e0-fc67-25f0 admin 192.168.3.251 AP6050DN nor 1
13M:50S
--------------------------------------------------------------------------------
-------------------
Total: 2
使用“dis radio all” 命令显示所有无线射频(Radio)接口的详细信息
<AC6005>dis radio all
CH/BW:Channel/Bandwidth
CE:Current EIRP (dBm)
ME:Max EIRP (dBm)
CU:Channel utilization
ST:Status
--------------------------------------------------------------------------------
AP ID Name RfID Band Type ST CH/BW CE/ME STA CU
--------------------------------------------------------------------------------
0 00e0-fca6-1840 0 2.4G bgn on 1/20M -/- 1 0%
0 00e0-fca6-1840 1 5G an11ac on 149/20M -/- 0 0%
1 00e0-fc67-25f0 0 2.4G bgn on 1/20M -/- 1 0%
1 00e0-fc67-25f0 1 5G an11ac on 149/20M -/- 0 0%
--------------------------------------------------------------------------------
Total:4
使用“dis vap all” 命令显示所有虚拟接入点(VAP)的详细信息
<AC6005>dis vap all
Info: This operation may take a few seconds, please wait.
WID : WLAN ID
--------------------------------------------------------------------------------
-
AP ID AP name RfID WID BSSID Status Auth type STA SSID
--------------------------------------------------------------------------------
-
0 00e0-fca6-1840 0 1 00E0-FCA6-1840 ON WPA/WPA2-PSK 1 admin
0 00e0-fca6-1840 1 1 00E0-FCA6-1850 ON WPA/WPA2-PSK 0 admin
1 00e0-fc67-25f0 0 1 00E0-FC67-25F0 ON WPA/WPA2-PSK 1 admin
1 00e0-fc67-25f0 1 1 00E0-FC67-2600 ON WPA/WPA2-PSK 0 admin
--------------------------------------------------------------------------------
-
Total: 4
这里就只查看其中一个获取IP地址情况,已经获取到了,这里就不进行互ping了,都这样了包通的
STA>ipconfig
Link local IPv6 address...........: ::
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.30.251
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.30.254
Physical address..................: 54-89-98-1F-43-88
DNS server........................: 8.8.8.8