配置802.1X认证示例(命令行)
802.1X认证简介
802.1X认证是网络接入控制方案(NAC)中的一种,它是基于端口对用户的网络访问权限进行控制的认证方法,通过802.1X认证能够实现保护企业内网安全性的目的。
802.1X认证安全性较高,但是需要客户终端安装802.1X客户端,网络部署不灵活。相较而言,NAC中的MAC认证方式不需要安装客户端,但是需要在认证服务器上登记MAC地址,管理复杂,而Portal认证方式同样不需要客户端并且部署灵活,但是安全性不高。所以,802.1X认证一般适用于新建网络、用户集中并且信息安全要求严格的场景。
AC和深澜Srun4000对接时,802.1X认证支持PAP、CHAP和EAP三种认证方式,本举例以EAP认证方式为例,PAP和CHAP认证方式的配置与之类似,但是PAP和CHAP认证方式下,终端需要安装客户端,如iNode智能客户端,并且安全策略必须为open或wep。
对于设备侧配置,如果您只需查阅802.1X认证相关的配置方法,请直接参见在AC上配置802.1X认证。
如果您只需查阅深澜Srun4000服务器侧的配置方法,请直接参见配置深澜Srun4000服务器计费管理系统和配置深澜Srun4000服务器用户后台管理系统。
数据规划
配置项 |
数据 |
---|---|
管理VLAN |
VLAN100 |
业务VLAN |
VLAN101 |
AC的源接口 |
VLANIF100:10.23.100.1/24 |
DHCP服务器 |
AC作为DHCP服务器为AP分配IP地址,SwitchB作为DHCP服务器为STA分配IP地址 |
AP的IP地址池 |
10.23.100.2~10.23.100.254/24 |
STA的IP地址池 |
10.23.101.2~10.23.101.254/24 |
RADIUS认证参数 |
|
802.1X接入模板 |
|
认证模板 |
|
AP组 |
|
域管理模板 |
|
SSID模板 |
|
安全模板 |
|
VAP模板 |
|
操作步骤
- 配置网络互通
# 配置接入交换机SwitchA的接口GE0/0/1和GE0/0/2加入VLAN100和VLAN101。
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 101 [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 101 [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 101 [SwitchA-GigabitEthernet0/0/2] quit
# 配置汇聚交换机SwitchB的接口GE0/0/1加入VLAN100和VLAN101,GE0/0/2加入VLAN100和VLAN102,GE0/0/3加入VLAN103,GE0/0/4加入VLAN104,创建VLANIF102、VLANIF103和VLANIF104接口,并配置下一跳为Router的缺省路由。<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 100 to 104 [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type trunk [SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 101 [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 102 [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 pvid vlan 103 [SwitchB-GigabitEthernet0/0/3] port trunk allow-pass vlan 103 [SwitchB-GigabitEthernet0/0/3] quit [SwitchB] interface gigabitethernet 0/0/4 [SwitchB-GigabitEthernet0/0/4] port link-type trunk [SwitchB-GigabitEthernet0/0/4] port trunk pvid vlan 104 [SwitchB-GigabitEthernet0/0/4] port trunk allow-pass vlan 104 [SwitchB-GigabitEthernet0/0/4] quit [SwitchB] interface vlanif 102 [SwitchB-Vlanif102] ip address 10.23.102.1 24 [SwitchB-Vlanif102] quit [SwitchB] interface vlanif 103 [SwitchB-Vlanif103] ip address 10.23.103.2 24 [SwitchB-Vlanif103] quit [SwitchB] interface vlanif 104 [SwitchB-Vlanif104] ip address 10.23.104.1 24 [SwitchB-Vlanif104] quit [SwitchB] ip route-static 0.0.0.0 0.0.0.0 10.23.104.2
# 配置AC的接口GE0/0/1加入VLAN100和VLAN102,创建VLANIF102接口,并配置指向RADIUS服务器的静态路由。<AC6605> system-view [AC6605] sysname AC [AC] vlan batch 100 101 102 [AC] interface gigabitethernet 0/0/1 [AC-GigabitEthernet0/0/1] port link-type trunk [AC-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 102 [AC-GigabitEthernet0/0/1] quit [AC] interface vlanif 102 [AC-Vlanif102] ip address 10.23.102.2 24 [AC-Vlanif102] quit [AC] ip route-static 10.23.103.0 24 10.23.102.1
- 配置AC作为DHCP服务器为AP分配IP地址,SwitchB作为DHCP服务器为STA分配IP地址
# 在AC上配置VLANIF100接口为AP提供IP地址。
[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上配置VLANIF101接口为STA提供IP地址。DNS服务器地址请根据实际需要配置。常用配置方法如下:- 接口地址池场景,需要在VLANIF接口视图下执行命令dhcp server dns-list ip-address &<1-8>。
- 全局地址池场景,需要在IP地址池视图下执行命令dns-list ip-address &<1-8>。
[SwitchB] dhcp enable [SwitchB] interface vlanif 101 [SwitchB-Vlanif101] ip address 10.23.101.1 24 [SwitchB-Vlanif101] dhcp select interface [SwitchB-Vlanif101] quit
- 配置AP上线
# 创建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 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. Continu e?[Y/N]:y [AC-wlan-ap-group-ap-group1] quit [AC-wlan-view] quit
# 配置AC的源接口。
[AC] capwap source interface vlanif 100
# 在AC上离线导入AP,并将AP加入AP组“ap-group1”中。假设AP的MAC地址为60de-4476-e360,并且根据AP的部署位置为AP配置名称,便于从名称上就能够了解AP的部署位置。例如MAC地址为60de-4476-e360的AP部署在1号区域,命名此AP为area_1。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 [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] ------------------------------------------------------------------------------------------------- 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
- 配置AP射频的信道和功率
射频的信道和功率自动调优功能默认开启,如果不关闭此功能则会导致手动配置不生效。举例中AP射频的信道和功率仅为示例,实际配置中请根据AP的国家码和网规结果进行配置。
# 关闭AP射频0的信道和功率自动调优功能,并配置AP射频0的信道和功率。[AC-wlan-view] ap-id 0 [AC-wlan-ap-0] radio 0 [AC-wlan-radio-0/0] calibrate auto-channel-select disable [AC-wlan-radio-0/0] calibrate auto-txpower-select disable [AC-wlan-radio-0/0] channel 20mhz 6 Warning: This action may cause service interruption. Continue?[Y/N]y [AC-wlan-radio-0/0] eirp 127 [AC-wlan-radio-0/0] quit
# 关闭AP射频1的信道和功率自动调优功能,并配置AP射频1的信道和功率。[AC-wlan-ap-0] radio 1 [AC-wlan-radio-0/1] calibrate auto-channel-select disable [AC-wlan-radio-0/1] calibrate auto-txpower-select disable [AC-wlan-radio-0/1] channel 20mhz 149 Warning: This action may cause service interruption. Continue?[Y/N]y [AC-wlan-radio-0/1] eirp 127 [AC-wlan-radio-0/1] quit [AC-wlan-ap-0] quit
- 在AC上配置802.1X认证
- 配置深澜Srun4000服务器计费管理系统
- 配置深澜Srun4000服务器用户后台管理系统
- 检查配置结果
- 完成配置后,用户可通过无线终端搜索到SSID为wlan-net的无线网络。
- 用户关联到无线网络上后,无线PC能够被分配相应的IP地址。
- 在STA上使用802.1X客户端进行认证,输入正确的用户名和密码后,STA认证成功,正常访问WLAN网络。需要根据设置的认证方式PEAP对客户端进行相应的配置。
Windows XP系统下的配置
- 首先在无线网络属性中,添加SSID为wlan-net,并选择认证方式为WPA2,加密使用的算法AES。
- 在“验证”选项卡中,选择EAP类型为PEAP,单击“属性”,去掉验证服务器证书选项(此处不验证服务器证书),单击“配置”,去掉自动使用Windows登录名和密码选项,然后单击“确定”。
Windows 7系统下的配置
- 进入管理无线网络页面,单击“添加”,选择手动创建网络配置文件,添加SSID为wlan-net,并选择认证方式为WPA2-企业,加密使用的算法AES,单击“下一步”。
- 单击“更改连接设置”,进入“无线网络属性”界面,选择“安全”页签,单击“设置”,取消勾选“验证服务器证书”(此处不验证服务器证书),单击“配置”,取消勾选“自动使用Windows登录名和密码”,单击“确定”。
- 单击“确定”,返回“无线网络属性”界面,单击“高级设置”,在“高级设置”界面,勾选“指定身份验证模式”,并选择身份验证模式为“用户身份验证”,单击“确定”。
无线用户接入后,在AC上执行命令display access-user access-type dot1x,可以查看到认证类型为“802.1X”的用户中,名为“huawei”的用户已成功上线。
[AC] display access-user access-type dot1x ------------------------------------------------------------------------------ UserID Username IP address MAC Status ------------------------------------------------------------------------------ 460 huawei 10.23.101.254 8000-6e74-e78a Success ------------------------------------------------------------------------------ Total: 1, printed: 1
配置文件
SwitchA的配置文件
# sysname SwitchA # vlan batch 100 to 101 # interface GigabitEthernet0/0/1 port link-type trunk port trunk pvid vlan 100 port trunk allow-pass vlan 100 to 101 port-isolate enable group 1 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 100 to 101 # return
SwitchB的配置文件
# sysname SwitchB # vlan batch 100 to 104 # dhcp enable # interface Vlanif101 ip address 10.23.101.1 255.255.255.0 dhcp select interface # interface Vlanif102 ip address 10.23.102.1 255.255.255.0 # interface Vlanif103 ip address 10.23.103.2 255.255.255.0 # interface Vlanif104 ip address 10.23.104.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 to 101 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 100 102 # interface GigabitEthernet0/0/3 port link-type trunk port trunk pvid vlan 103 port trunk allow-pass vlan 103 # interface GigabitEthernet0/0/4 port link-type trunk port trunk pvid vlan 104 port trunk allow-pass vlan 104 # ip route-static 0.0.0.0 0.0.0.0 10.23.104.2 # return
Router的配置文件
# sysname Router # interface GigabitEthernet0/0/1 ip address 10.23.104.2 255.255.255.0 # ip route-static 10.23.101.0 255.255.255.0 10.23.104.1 # return
AC的配置文件
# sysname AC # vlan batch 100 to 102 # authentication-profile name wlan-net dot1x-access-profile wlan-net authentication-scheme wlan-net radius-server wlan-net # dhcp enable # radius-server template wlan-net radius-server shared-key cipher %^%#*7d1;XNof/|Q0:DsP!,W51DIYPx}`AARBdJ'0B^$%^%# radius-server authentication 10.23.103.1 1812 weight 80 # aaa authentication-scheme wlan-net authentication-mode radius # interface Vlanif100 ip address 10.23.100.1 255.255.255.0 dhcp select interface # interface Vlanif102 ip address 10.23.102.2 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 102 # ip route-static 10.23.103.0 255.255.255.0 10.23.102.1 # capwap source interface vlanif100 # wlan security-profile name wlan-net security wpa-wpa2 dot1x aes ssid-profile name wlan-net ssid wlan-net vap-profile name wlan-net service-vlan vlan-id 101 ssid-profile wlan-net security-profile wlan-net authentication-profile wlan-net regulatory-domain-profile name default ap-group name ap-group1 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 radio 0 channel 20mhz 6 eirp 127 calibrate auto-channel-select disable calibrate auto-txpower-select disable radio 1 channel 20mhz 149 eirp 127 calibrate auto-channel-select disable calibrate auto-txpower-select disable # dot1x-access-profile name wlan-net # return