本文介绍的WLAN网络是指利用频率为2.4GHz或5GHz的射频信号作为传输介质的无线局域网,相对于有线网络的铺设成本高,不便于网络调整和扩展、位置固定,移动性差等缺点,WLAN网络以其低廉的铺设成本、便捷的网络调整和扩展、灵活的可移动性获得了越来越广泛的应用。
小型WLAN网络定位为中小型企业包括独立的小型园区网,也包括只在分支机构部署WLAN的场景。由于规模较小,小型WLAN网络通常只需要使用少量的网络设备部署一个简单的WLAN网络,为小范围内的用户提供WLAN网络服务。
WLAN举例通用配置注意事项请参考WLAN通用注意事项,更多部署和配置建议请参考无线网络部署和配置建议。
从V200R011C10版本开始,WLAN配置会自动下发,不需要再执行命令commit all提交配置。
本举例使用的安全策略为WPA2-PSK-AES,为保证实际网络的安全性,请根据实际的需求配置合适的安全策略。
隧道转发模式下,管理VLAN和业务VLAN不能配置为同一VLAN。直接转发模式下,管理VLAN和业务VLAN建议也不要配置为同一VLAN。
数据转发方式为直接转发时,建议在直接连接AP的设备接口上配置端口隔离,如果不配置端口隔离,可能会在VLAN内存在不必要的广播报文,或者导致不同AP间的WLAN用户二层互通的问题。
适用的产品和版本请参见WLAN AP版本配套和形态速查表。
某企业分支机构规模较小,为了保证工作人员可以随时随地的访问公司网络,通过部署小型WLAN网络实现移动办公。
如图1所示,AC通过PoE交换机与AP连接,PoE交换机为AP供电。通过在AC上配置WLAN业务的相关内容,下发给AP生成WLAN网络供用户接入。
配置项 |
数据 |
---|---|
DHCP服务器 |
AC作为DHCP服务器为STA和AP分配IP地址 |
AP的IP地址池 |
10.23.100.2~10.23.100.254/24 |
STA的IP地址池 |
10.23.101.2~10.23.101.254/24 |
AC的源接口IP地址 |
VLANIF100:10.23.100.1/24 |
AP组 |
|
域管理模板 |
|
SSID模板 |
|
安全模板 |
|
VAP模板 |
|
采用如下的思路配置小型网络的WLAN基本业务:
# 配置SwitchA连接AP的接口GE0/0/1加入VLAN100(管理VLAN),SwitchA连接AC的接口GE0/0/2加入VLAN100。
system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 100
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk pvid vlan 100
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet0/0/1] undo port trunk allow-pass vlan 1
[SwitchA-GigabitEthernet0/0/1] stp edged-port enable
[SwitchA-GigabitEthernet0/0/1] port-isolate enable
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet0/0/2] undo port trunk allow-pass vlan 1
[SwitchA-GigabitEthernet0/0/2] quit
# 配置AC连接SwitchA的接口GE1/0/1加入VLAN100。
system-view
[HUAWEI] sysname AC
[AC] vlan batch 100 101
[AC] interface gigabitethernet 1/0/1
[AC-GigabitEthernet1/0/1] port link-type trunk
[AC-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[AC-GigabitEthernet1/0/1] undo port trunk allow-pass vlan 1
[AC-GigabitEthernet1/0/1] quit
根据实际组网情况在AC上行口配置业务VLAN透传,和上行网络设备互通。
# 配置AC上行接口GE1/0/2加入VLAN101(业务VLAN)。
[AC] interface gigabitethernet 1/0/2
[AC-GigabitEthernet1/0/2] port link-type trunk
[AC-GigabitEthernet1/0/2] port trunk allow-pass vlan 101
[AC-GigabitEthernet1/0/2] undo port trunk allow-pass vlan 1
[AC-GigabitEthernet1/0/2] quit
# 配置基于接口地址池的DHCP服务器,其中,VLANIF100接口为AP提供IP地址,VLANIF101为STA提供IP地址。
[AC] dhcp enable //使能DHCP功能
[AC] interface vlanif 100
[AC-Vlanif100] ip address 10.23.100.1 24
[AC-Vlanif100] dhcp select interface //配置基于接口的地址池
[AC-Vlanif100] quit
[AC] interface vlanif 101
[AC-Vlanif101] ip address 10.23.101.1 24
[AC-Vlanif101] dhcp select interface
[AC-Vlanif101] quit
# 创建AP组,用于将相同配置的AP都加入同一AP组中。
[AC] wlan
[AC-wlan-view] ap-group name ap-group1
[AC-wlan-ap-group-ap-group1] quit
# 创建域管理模板,在域管理模板下配置AC的国家码并在AP组下引用域管理模板。
[AC-wlan-view] regulatory-domain-profile name domain1
[AC-wlan-regulate-domain-domain1] country-code cn
[AC-wlan-regulate-domain-domain1] quit
[AC-wlan-view] ap-group name ap-group1
[AC-wlan-ap-group-ap-group1] regulatory-domain-profile domain1
Warning: This configuration change will clear the channel and power configurations of radios, and may restart APs. Continue?[Y/N]:y
[AC-wlan-ap-group-ap-group1] quit
[AC-wlan-view] quit
# 配置AC的源接口。
[AC] capwap source interface vlanif 100
ap auth-mode命令缺省情况下为MAC认证,如果之前没有修改其缺省配置,可以不用执行ap auth-mode mac-auth。
举例中使用的AP具有射频0和射频1两个射频。射频0为2.4GHz射频,射频1为5GHz射频。
[AC] wlan
[AC-wlan-view] ap auth-mode mac-auth
[AC-wlan-view] ap-id 0 ap-mac 00e0-fc11-1111
[AC-wlan-ap-0] ap-name area_1
[AC-wlan-ap-0] ap-group ap-group1
Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and antenna gain configuration s of the radio, Whether to continue? [Y/N]:y
[AC-wlan-ap-0] quit
# 将AP上电后,当执行命令display ap all查看到AP的“State”字段为“nor”时,表示AP正常上线。
[AC-wlan-view] display ap all
Total AP information:
nor : normal [1]
Extrainfo : Extra information
P : insufficient power supply
--------------------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime ExtraInfo
--------------------------------------------------------------------------------------------------
0 00e0-fc11-1111 area_1 ap-group1 10.23.100.254 AP5030DN nor 0 10S -
--------------------------------------------------------------------------------------------------
Total: 1
举例中以配置WPA2+PSK+AES的安全策略为例,密码为“YsHsjx_202206”,实际配置中请根据实际情况,配置符合实际要求的安全策略。
[AC-wlan-view] security-profile name wlan-security
[AC-wlan-sec-prof-wlan-security] security wpa2 psk pass-phrase YsHsjx_202206 aes //配置安全策略为WPA2+PSK+AES
[AC-wlan-sec-prof-wlan-security] quit
# 创建名为“wlan-ssid”的SSID模板,并配置SSID名称为“wlan-net”。
[AC-wlan-view] ssid-profile name wlan-ssid
[AC-wlan-ssid-prof-wlan-ssid] ssid wlan-net //配置SSID名称为wlan-net
[AC-wlan-ssid-prof-wlan-ssid] quit
# 创建名为“wlan-vap”的VAP模板,配置业务数据转发模式、业务VLAN,并且引用安全模板和SSID模板。
[AC-wlan-view] vap-profile name wlan-vap
[AC-wlan-vap-prof-wlan-vap] forward-mode tunnel //配置业务转发模式为隧道转发
[AC-wlan-vap-prof-wlan-vap] service-vlan vlan-id 101 //缺省情况下VLAN ID为1,修改VLAN ID为101
[AC-wlan-vap-prof-wlan-vap] security-profile wlan-security
[AC-wlan-vap-prof-wlan-vap] ssid-profile wlan-ssid
[AC-wlan-vap-prof-wlan-vap] quit
# 配置AP组引用VAP模板,AP上射频0和射频1都使用VAP模板“wlan-vap”的配置。
[AC-wlan-view] ap-group name ap-group1
[AC-wlan-ap-group-ap-group1] vap-profile wlan-vap wlan 1 radio 0
[AC-wlan-ap-group-ap-group1] vap-profile wlan-vap wlan 1 radio 1
[AC-wlan-ap-group-ap-group1] quit
[AC-wlan-view] commit all
Warning: Committing configuration may cause service interruption, continue?[Y/N]:y
配置完成后,通过执行命令display vap ssid wlan-net查看如下信息,当“Status”项显示为“ON”时,表示AP对应的射频上的VAP已创建成功。
[AC-wlan-view] display vap ssid wlan-net
WID : WLAN ID
--------------------------------------------------------------------------------
AP ID AP name RfID WID BSSID Status Auth type STA SSID
--------------------------------------------------------------------------------
0 area_1 0 1 00E0-FC11-1111 ON WPA2-PSK 0 wlan-net
0 area_1 1 1 00E0-FC11-1112 ON WPA2-PSK 0 wlan-net
-------------------------------------------------------------------------------
Total: 2
STA搜索到名为“wlan-net”的无线网络,输入密码“YsHsjx_202206”并正常关联后,在AC上执行display station ssid wlan-net命令,可以查看到用户已经接入到无线网络“wlan-net”中。
[AC-wlan-view] display station ssid wlan-net
Rf/WLAN: Radio ID/WLAN ID
Rx/Tx: link receive rate/link transmit rate(Mbps)
---------------------------------------------------------------------------------
STA MAC AP ID Ap name Rf/WLAN Band Type Rx/Tx RSSI VLAN IP address
---------------------------------------------------------------------------------
00e0-fc11-1115 0 area_1 1/1 5G 11n 46/59 -68 101 10.23.101.254
---------------------------------------------------------------------------------
Total: 1 2.4G: 0 5G: 1
SwitchA的配置文件
#
sysname SwitchA
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
stp edged-port enable
port-isolate enable group 1
#
interface GigabitEthernet0/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
return
AC的配置文件
#
sysname AC
#
vlan batch 100 to 101
#
dhcp enable
#
interface Vlanif100
ip address 10.23.100.1 255.255.255.0
dhcp select interface
#
interface Vlanif101
ip address 10.23.101.1 255.255.255.0
dhcp select interface
#
interface GigabitEthernet1/0/1
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface GigabitEthernet1/0/2
port link-type trunk
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 101
#
capwap source interface vlanif100
#
wlan
security-profile name wlan-security
security wpa2 psk pass-phrase %^%#m"tz0f>~7.[`^6RWdzwCy16hJj/Mc!,}s`X*B]}A%^%# aes
ssid-profile name wlan-ssid
ssid wlan-net
vap-profile name wlan-vap
forward-mode tunnel
service-vlan vlan-id 101
ssid-profile wlan-ssid
security-profile wlan-security
regulatory-domain-profile name domain1
ap-group name ap-group1
regulatory-domain-profile domain1
radio 0
vap-profile wlan-vap wlan 1
radio 1
vap-profile wlan-vap wlan 1
ap-id 0 type-id 35 ap-mac 00e0-fc11-1111 ap-sn 210235554710CB000042
ap-name area_1
ap-group ap-group1
#
return