某企业为了提高WLAN网络的安全性,采用MAC优先的外置Portal认证方式,实现对用户的接入控制。
配置项 |
数据 |
---|---|
AP管理VLAN |
VLAN100 |
STA业务VLAN |
VLAN101 |
DHCP服务器 |
AC作为DHCP服务器为AP分配IP地址 汇聚交换机SwitchB作为DHCP服务器为STA分配IP地址,STA的默认网关为10.23.101.2 |
AP的IP地址池 |
10.23.100.2~10.23.100.254/24 |
STA的IP地址池 |
10.23.101.4~10.23.101.254/24 |
AC的源接口IP地址 |
VLANIF100:10.23.100.1/24 |
AP组 |
|
域管理模板 |
|
SSID模板 |
|
安全模板 |
|
RADIUS认证参数 |
RADIUS认证方案名称:wlan-net RADIUS计费方案名称:wlan-net RADIUS服务器模板名称:wlan-net,其中:
|
Portal服务器模板 |
|
Portal接入模板 |
|
MAC接入模板 |
名称:wlan-net |
免认证规则模板 |
|
认证模板 |
|
VAP模板 |
|
建议在与AP直连的设备接口上配置端口隔离,如果不配置端口隔离,尤其是业务数据转发方式采用直接转发时,可能会在VLAN内形成大量不必要的广播报文,导致网络阻塞,影响用户体验。
隧道转发模式下,管理VLAN和业务VLAN不能配置为同一VLAN,且AP和AC之间只能放通管理VLAN,不能放通业务VLAN。
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] 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] quit
system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 100 101
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 101
[SwitchB-GigabitEthernet0/0/2] quit
[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] port link-type trunk
[SwitchB-GigabitEthernet0/0/3] port trunk allow-pass vlan 101
[SwitchB-GigabitEthernet0/0/3] quit
system-view
[Huawei] sysname Router
[Router] vlan batch 101
[Router] interface gigabitethernet 1/0/0
[Router-GigabitEthernet1/0/0] port link-type trunk
[Router-GigabitEthernet1/0/0] port trunk allow-pass vlan 101
[Router-GigabitEthernet1/0/0] quit
[Router] interface vlanif 101
[Router-Vlanif101] ip address 10.23.101.2 24
[Router-Vlanif101] quit
如果AC直接连接AP,需要在AC直连AP的接口上配置缺省VLAN为管理VLAN100。
system-view
[HUAWEI] sysname AC
[AC] vlan batch 100 101
[AC] interface gigabitethernet 0/0/1
[AC-GigabitEthernet0/0/1] port link-type trunk
[AC-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 101
[AC-GigabitEthernet0/0/1] quit
[AC] dhcp enable
[AC] interface vlanif 100
[AC-Vlanif100] ip address 10.23.100.1 24
[AC-Vlanif100] dhcp select interface
[AC-Vlanif100] quit
[SwitchB] dhcp enable
[SwitchB] interface vlanif 101
[SwitchB-Vlanif101] ip address 10.23.101.1 24
[SwitchB-Vlanif101] dhcp select interface
[SwitchB-Vlanif101] dhcp server gateway-list 10.23.101.2
[SwitchB-Vlanif101] dhcp server dns-list 8.8.8.8
[SwitchB-Vlanif101] dhcp server excluded-ip-address 10.23.101.3
[SwitchB-Vlanif101] quit
[AC] interface vlanif 101
[AC-Vlanif101] ip address 10.23.101.3 24
[AC-Vlanif101] quit
[AC] ip route-static 0.0.0.0 0.0.0.0 10.23.101.2
[AC] wlan
[AC-wlan-view] ap-group name ap-group1
[AC-wlan-ap-group-ap-group1] quit
[AC-wlan-view] regulatory-domain-profile name default
[AC-wlan-regulate-domain-default] country-code cn
[AC-wlan-regulate-domain-default] quit
[AC-wlan-view] ap-group name ap-group1
[AC-wlan-ap-group-ap-group1] regulatory-domain-profile default
Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and reset the AP. Continue?[Y/N]:y
[AC-wlan-ap-group-ap-group1] quit
[AC-wlan-view] quit
V200R021C00版本开始,配置CAPWAP源接口或源地址时,会检查和安全相关的配置是否已存在,包括DTLS加密的PSK、AC间DTLS加密的PSK、登录AP的用户名和密码、全局离线管理VAP的登录密码,均已存在才能成功配置,否则会提示用户先完成相关的配置。
[AC] capwap source interface vlanif 100
Set the DTLS PSK(contains 6-32 plain-text characters, or 48 or 68 cipher-text characters that must be a combination of at least two of the following: lowercase letters a to z, uppercase letters A to Z, digits, and special characters):******
Set the DTLS inter-controller PSK(contains 6-32 plain-text characters, or 48 or 68 cipher-text characters that must be a combination of at least two of the following: lowercase letters a to z, uppercase letters A to Z, digits, and special characters):******
Set the user name for FIT APs(contains 4-31 plain-text characters, which can only include letters, digits and underlines. And the first character must be a letter):admin
Set the password for FIT APs(plain-text password of 8-128 characters or cipher-text password of 48-188 characters that must be a combination of at least three of the following: lowercase letters a to z, uppercase letters A to Z, digits, and special characters):********
Set the global temporary-management psk(contains 8-63 plain-text characters, or 48-108 cipher-text characters that must be a combination of at least two of the following: lowercase letters a to z, uppercase letters A to Z, digits, and special characters):********
[AC] capwap dtls no-auth enable
ap auth-mode命令缺省情况下为MAC认证,如果之前没有修改其缺省配置,可以不用执行ap auth-mode mac-auth。
举例中使用的AP为AP5030DN,具有射频0和射频1两个射频。AP5030DN的射频0为2.4GHz射频,射频1为5GHz射频。
[AC] wlan
[AC-wlan-view] ap auth-mode mac-auth
[AC-wlan-view] ap-id 0 ap-mac 60de-4476-e360
[AC-wlan-ap-0] ap-name area_1
Warning: This operation may cause AP reset. Continue? [Y/N]:y
[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
[AC-wlan-view] display ap all
Total AP information:
nor : normal [1]
Extra information:
P : insufficient power supply
--------------------------------------------------------------------------------------------------
ID MAC Name Group IP Type State STA Uptime ExtraInfo
--------------------------------------------------------------------------------------------------
0 60de-4476-e360 area_1 ap-group1 10.23.100.254 AP5030DN nor 0 10S -
--------------------------------------------------------------------------------------------------
Total: 1
[AC-wlan-view] quit
[AC] undo capwap dtls no-auth enable
[AC] wlan
请确保AC上的RADIUS服务器地址、端口号、共享密钥配置正确,并且和RADIUS服务器保持一致。
# 配置RADIUS服务器模板。
[AC] radius-server template wlan-net
[AC-radius-wlan-net] radius-server authentication 10.23.102.1 1812
[AC-radius-wlan-net] radius-server shared-key cipher Huawei123
[AC-radius-wlan-net] quit
# 创建认证方案并配置认证方式为RADIUS。
[AC] aaa
[AC-aaa] authentication-scheme wlan-net
[AC-aaa-authen-wlan-net] authentication-mode radius
[AC-aaa-authen-wlan-net] quit
# 创建计费方案并配置计费方式为RADIUS。
[AC-aaa] accounting-scheme wlan-net
[AC-aaa-accounting-wlan-net] accounting-mode radius
[AC-aaa-accounting-wlan-net] accounting realtime 15
[AC-aaa-accounting-wlan-net] quit
[AC-aaa] quit
以AC与Agile Controller-Campus对接为例,计费功能并非真实意义上的计算费用,而是通过计费报文维护终端的在线信息。
accounting realtime命令用来配置实时计费间隔。实时计费间隔的取值对设备和RADIUS服务器的性能有要求,实时计费间隔的取值越小,对设备和RADIUS服务器的性能要求就越高。请根据用户数设置实时计费间隔。
用户数 |
实时计费间隔 |
---|---|
1~99 |
3min |
100~499 |
6min |
500~999 |
12min |
≥1000 |
≥15min |
为了重定向更安全和快速,建议采用域名方式,但需要提前在DNS服务器配置域名与服务器IP地址的映射关系。
AC上配置的URL携带的参数字段名称,和服务器侧应保持一致。
[AC] url-template name wlan-net
[AC-url-template-wlan-net] url http://portal.com:8080/portal
[AC-url-template-wlan-net] url-parameter ssid ssid redirect-url url
[AC-url-template-wlan-net] quit
请确保AC上Portal服务器地址、URL地址、端口号、共享密钥配置正确,并且和Portal服务器保持一致。
[AC] web-auth-server wlan-net
[AC-web-auth-server-wlan-net] server-ip 10.23.103.1
[AC-web-auth-server-wlan-net] shared-key cipher Huawei123
[AC-web-auth-server-wlan-net] port 50200
[AC-web-auth-server-wlan-net] url-template wlan-net ciphered-parameter-name cpname iv-parameter-name iv-value key cipher Huawei123
[AC-web-auth-server-wlan-net] quit
[AC] portal-access-profile name wlan-net
[AC-portal-access-profile-wlan-net] web-auth-server wlan-net direct
[AC-portal-access-profile-wlan-net] quit
[AC] mac-access-profile name wlan-net
[AC-mac-access-profile-wlan-net] quit
[AC] free-rule-template name default_free_rule
[AC-free-rule-default_free_rule] free-rule 1 destination ip 8.8.8.8 mask 32
[AC-free-rule-default_free_rule] quit
[AC] authentication-profile name wlan-net
[AC-authentication-profile-wlan-net] portal-access-profile wlan-net
[AC-authentication-profile-wlan-net] mac-access-profile wlan-net
[AC-authentication-profile-wlan-net] free-rule-template default_free_rule
[AC-authentication-profile-wlan-net] authentication-scheme wlan-net
[AC-authentication-profile-wlan-net] radius-server wlan-net
[AC-authentication-profile-wlan-net] quit
# 创建名为“wlan-net”的安全模板,并配置安全策略为open方式的开放认证。
[AC] wlan
[AC-wlan-view] security-profile name wlan-net
[AC-wlan-sec-prof-wlan-net] security open
[AC-wlan-sec-prof-wlan-net] quit
# 创建名为“wlan-net”的SSID模板,并配置SSID名称为“wlan-net”。
[AC-wlan-view] ssid-profile name wlan-net
[AC-wlan-ssid-prof-wlan-net] ssid wlan-net
[AC-wlan-ssid-prof-wlan-net] quit
# 创建名为“wlan-net”的VAP模板,配置业务数据转发模式、业务VLAN,并且引用安全模板、SSID模板和认证模板。
[AC-wlan-view] vap-profile name wlan-net
[AC-wlan-vap-prof-wlan-net] forward-mode tunnel
[AC-wlan-vap-prof-wlan-net] service-vlan vlan-id 101
[AC-wlan-vap-prof-wlan-net] security-profile wlan-net
[AC-wlan-vap-prof-wlan-net] ssid-profile wlan-net
[AC-wlan-vap-prof-wlan-net] authentication-profile wlan-net
[AC-wlan-vap-prof-wlan-net] quit
# 配置AP组引用VAP模板,AP上射频0和射频1都使用VAP模板“wlan-net”的配置。
[AC-wlan-view] ap-group name ap-group1
[AC-wlan-ap-group-ap-group1] vap-profile wlan-net wlan 1 radio 0
[AC-wlan-ap-group-ap-group1] vap-profile wlan-net wlan 1 radio 1
[AC-wlan-ap-group-ap-group1] quit
[AC-wlan-view] quit
具体配置方法建议参考相应的产品手册。
完成配置后,STA可以搜索到SSID为wlan-net的无线网络。
SwitchA的配置文件
#
sysname SwitchA
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk pvid vlan 100
port trunk allow-pass vlan 100
port-isolate enable group 1
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100
#
return
SwitchB的配置文件
#
sysname SwitchB
#
vlan batch 100 to 101
#
dhcp enable
#
interface Vlanif101
ip address 10.23.101.1 255.255.255.0
dhcp select interface
dhcp server gateway-list 10.23.101.2
dhcp server dns-list 8.8.8.8
dhcp server excluded-ip-address 10.23.101.3
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100 to 101
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 101
#
return
Router的配置文件
#
sysname Router
#
vlan batch 101
#
interface Vlanif101
ip address 10.23.101.2 255.255.255.0
#
interface GigabitEthernet1/0/0
port link-type trunk
port trunk allow-pass vlan 101
#
return
AC的配置文件
#
sysname AC
#
vlan batch 100 to 101
#
authentication-profile name wlan-net
mac-access-profile wlan-net
portal-access-profile wlan-net
free-rule-template default_free_rule
authentication-scheme wlan-net
radius-server wlan-net
#
dhcp enable
#
aaa
authentication-scheme wlan-net
authentication-mode radius
accounting-scheme wlan-net
accounting-mode radius
accounting realtime 15
#
interface Vlanif100
ip address 10.23.100.1 255.255.255.0
dhcp select interface
#
interface Vlanif101
ip address 10.23.101.3 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100 101
#
ip route-static 0.0.0.0 0.0.0.0 10.23.101.2
#
capwap source interface vlanif100
#
radius-server template wlan-net
radius-server shared-key cipher %^%#Oc6_BMCw#9gZ2@SMVtk!PAC6>Ou*eLW/"qLp+f#$%^%#
radius-server authentication 10.23.102.1 1812 weight 80
#
free-rule-template name default_free_rule
free-rule 1 destination ip 8.8.8.8 mask 255.255.255.255
#
url-template name wlan-net
url http://portal.com:8080/portal
#
web-auth-server wlan-net
server-ip 10.23.103.1
port 50200
shared-key cipher %^%#4~ZXE3]6@BXu;2;aw}hA{rSb,@"L@T#e{%6G1AiD%^%#
url-template wlan-net ciphered-parameter-name cpname iv-parameter-name iv-value key cipher %^%#4~ZXE3]6@BXu;2;aw}hA{rSb,@"L@T#e{%6G1AiD%^%#
#
portal-access-profile name wlan-net
web-auth-server wlan-net direct
#
wlan
security-profile name wlan-net
ssid-profile name wlan-net
ssid wlan-net
vap-profile name wlan-net
forward-mode tunnel
service-vlan vlan-id 101
ssid-profile wlan-net
security-profile wlan-net
authentication-profile wlan-net
ap-group name ap-group1
regulatory-domain-profile default
radio 0
vap-profile wlan-net wlan 1
radio 1
vap-profile wlan-net wlan 1
ap-id 0 type-id 35 ap-mac 60de-4476-e360 ap-sn 210235554710CB000042
ap-name area_1
ap-group ap-group1
#
mac-access-profile name wlan-net
#
return