配置有线无线用户混合认证示例
组网需求
如图2-75所示,SwitchC作为接入交换机,SwitchB作为汇聚交换机,SwitchA作为核心交换机,并为用户及AP分配IP地址。企业中有线用户通过SwitchC接入,无线用户通过SwitchC下接的AP接入,用户需通过802.1X或MAC认证后才能访问网络,由于认证服务器上不会存储AP的信息,配置AP不需要认证。
配置注意事项
- 本举例主要介绍Switch上的NAC相关配置,AP上线、WLAN业务等配置这里不做相关说明。
RADIUS服务器上配置的RADIUS认证和计费密钥需与设备上配置的RADIUS服务器的共享密钥一致。
- Portal服务器上配置的Portal密钥、端口号需与设备上配置的共享密钥、设备侦听Portal协议报文的端口号一致。
- 设备默认出接口的IP地址作为向RADIUS服务器发送RADIUS报文时使用的源IP地址,该IP地址需与RADIUS服务器上配置的设备IP地址一致。用户可以通过如下命令修改该IP地址:
- 执行命令radius-server authentication ip-address port source,配置RADIUS认证服务器,并指定与RADIUS认证服务器发送RADIUS报文时使用的源IP地址。
- 执行命令radius-server accounting ip-address port source,配置RADIUS计费服务器,并指定与RADIUS计费服务器发送RADIUS报文时使用的源IP地址。
- 设备默认出接口的IP地址作为向Portal服务器发送Portal报文时使用的源IP地址,该IP地址需与Portal服务器上配置的设备IP地址一致。用户可以通过命令source-interface或source-ip修改该IP地址。
- 举例中的RADIUS/Portal服务器以华为公司的Agile Controller-Campus为例,Agile Controller-Campus的支持版本为V100R003C60。
配置思路
- 在Switch上配置网络互连互通。
- 在SwitchA上配置DHCP功能,为用户和AP分配地址。
- 在SwitchA上配置AAA,为用户进行RADIUS认证、授权、计费,并对AP不认证。
- 在SwitchA上配置802.1X和MAC认证,对用户进行接入认证。
操作步骤
- 配置网络互连互通
# 在SwitchA上创建VLAN并配置接口允许通过的VLAN。
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 200 300 [SwitchA] interface eth-trunk 10 [SwitchA-Eth-Trunk10] port link-type trunk [SwitchA-Eth-Trunk10] port trunk allow-pass vlan 100 200 [SwitchA-Eth-Trunk10] quit [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] eth-trunk 10 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] eth-trunk 10 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type trunk [SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 300 [SwitchA-GigabitEthernet0/0/3] quit [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 10.1.1.1 24 [SwitchA-Vlanif100] quit [SwitchA] interface vlanif 200 [SwitchA-Vlanif200] ip address 10.2.1.1 24 [SwitchA-Vlanif200] quit [SwitchA] interface vlanif 300 [SwitchA-Vlanif300] ip address 10.3.1.1 24 [SwitchA-Vlanif300] quit [SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.3.1.2
# 在SwitchB上配置802.1X报文透传功能、创建VLAN并配置接口允许通过的VLAN。
SwitchB作为二层交换机,为保证用户能够通过802.1X认证,需在SwitchB上配置802.1X报文透传功能。本例的二层交换机以S5720-LI为例。
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 100 200 [SwitchB] l2protocol-tunnel user-defined-protocol 802.1X protocol-mac 0180-c200-0003 group-mac 0100-0000-0002 [SwitchB] interface eth-trunk 10 [SwitchB-Eth-Trunk10] l2protocol-tunnel user-defined-protocol 802.1X enable [SwitchB-Eth-Trunk10] bpdu enable [SwitchB-Eth-Trunk10] port link-type trunk [SwitchB-Eth-Trunk10] port trunk allow-pass vlan 100 200 [SwitchB-Eth-Trunk10] quit [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] eth-trunk 10 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface gigabitethernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] eth-trunk 10 [SwitchB-GigabitEthernet0/0/2] quit [SwitchB] interface gigabitethernet 0/0/3 [SwitchB-GigabitEthernet0/0/3] l2protocol-tunnel user-defined-protocol 802.1X enable [SwitchB-GigabitEthernet0/0/3] bpdu enable [SwitchB-GigabitEthernet0/0/3] port link-type trunk [SwitchB-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200 [SwitchB-GigabitEthernet0/0/3] quit
# 在SwitchC上配置802.1X报文透传功能、创建VLAN并配置接口允许通过的VLAN。
SwitchC作为二层交换机,为保证用户能够通过802.1X认证,需在SwitchC上配置802.1X报文透传功能。本例的二层交换机以S5720-LI为例。
<HUAWEI> system-view [HUAWEI] sysname SwitchC [SwitchC] vlan batch 100 200 [SwitchC] l2protocol-tunnel user-defined-protocol 802.1X protocol-mac 0180-c200-0003 group-mac 0100-0000-0002 [SwitchC] interface gigabitethernet 0/0/1 [SwitchC-GigabitEthernet0/0/1] l2protocol-tunnel user-defined-protocol 802.1X enable [SwitchC-GigabitEthernet0/0/1] bpdu enable [SwitchC-GigabitEthernet0/0/1] port link-type access [SwitchC-GigabitEthernet0/0/1] port default vlan 100 [SwitchC-GigabitEthernet0/0/1] quit [SwitchC] interface gigabitethernet 0/0/2 [SwitchC-GigabitEthernet0/0/2] l2protocol-tunnel user-defined-protocol 802.1X enable [SwitchC-GigabitEthernet0/0/2] bpdu enable [SwitchC-GigabitEthernet0/0/2] port link-type access [SwitchC-GigabitEthernet0/0/2] port default vlan 200 [SwitchC-GigabitEthernet0/0/2] quit [SwitchC] interface gigabitethernet 0/0/3 [SwitchC-GigabitEthernet0/0/3] l2protocol-tunnel user-defined-protocol 802.1X enable [SwitchC-GigabitEthernet0/0/3] bpdu enable [SwitchC-GigabitEthernet0/0/3] port link-type trunk [SwitchC-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200 [SwitchC-GigabitEthernet0/0/3] quit
- 在SwitchA上配置DHCP功能。
配置VLANIF100为AP分配地址、VLANIF200为有线用户分配地址、VLANIF300为无线用户分配IP地址。
[SwitchA] dhcp enable [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] dhcp select interface [SwitchA-Vlanif100] quit [SwitchA] interface vlanif 200 [SwitchA-Vlanif200] dhcp select interface [SwitchA-Vlanif200] quit [SwitchA] interface vlanif 300 [SwitchA-Vlanif300] dhcp select interface [SwitchA-Vlanif300] quit
- 在SwitchA上配置AAA。
- 在SwitchA上配置802.1X和MAC认证。# 将NAC配置模式切换成统一模式。
[SwitchA] authentication unified-mode
设备默认为统一模式。传统模式与统一模式相互切换后,设备会自动重启。
# 配置MAC接入模板。[SwitchA] mac-access-profile name m1 [SwitchA-mac-access-profile-m1] quit
# 配置802.1X接入模板。[SwitchA] dot1x-access-profile name d1 [SwitchA-dot1x-access-profile-d1] dot1x authentication-method eap [SwitchA-dot1x-access-profile-d1] quit
# 在认证模板“p1”下绑定MAC接入模板和802.1X接入模板。[SwitchA] authentication-profile name p1 [SwitchA-authen-profile-p1] mac-access-profile m1 [SwitchA-authen-profile-p1] dot1x-access-profile d1
# 使能MAC旁路认证功能和认证域。
[SwitchA-authen-profile-p1] authentication dot1x-mac-bypass [SwitchA-authen-profile-p1] access-domain isp [SwitchA-authen-profile-p1] quit
# 在接口下绑定认证模板。[SwitchA] interface eth-trunk 10 [SwitchA-Eth-Trunk10] authentication-profile p1 [SwitchA-Eth-Trunk10] quit
- 配置Agile Controller-Campus。
- 登录Agile Controller-Campus。
- 选择“资源 > 用户管理”,点击 按钮,创建普通账号。
- 选择“资源 > 设备 > 设备管理”,单击 ,设置SwitchA的参数,包括SwitchA的IP地址、RADIUS认证和计费相关参数。
- 验证配置结果。
用户认证成功后即可访问网络。
用户上线后,管理员可在设备上执行命令display access-user查看在线用户信息。