配置RADIUS服务器故障时的用户逃生功能示例
组网需求
如图1-36所示,SwitchA作为某企业网络的NAS设备,网络中部署了两台RADIUS服务器,企业内用户的认证方式为802.1X+RADIUS认证,认证成功后能够访问Internet。现在,管理员希望在RADIUS服务器故障的情况下,用户能够进入逃生,逃生时的权限与认证成功后的权限一致;在RADIUS服务器故障恢复后,用户能够进行重认证,重新使用RADIUS服务器授权。
数据规划
配置项 |
数据 |
---|---|
RADIUS服务器选择算法 |
主备算法(缺省值) |
将RADIUS服务器标记为Down的条件 |
|
RADIUS请求报文重传 |
|
自动探测 |
|
RADIUS服务器故障时的逃生权限 |
企业用户能够访问Internet |
配置思路
- 配置RADIUS认证。
- 配置RADIUS服务器状态探测。
- 配置802.1x认证。
- 配置RADIUS服务器故障时的逃生权限和RADIUS服务器故障恢复时的重认证功能。
请确保Switch与RADIUS服务器路由可达。
操作步骤
- 创建VLAN并配置接口允许通过的VLAN。
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10 20 [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type access [SwitchA-GigabitEthernet0/0/2] port default vlan 20 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 192.168.2.10 24 [SwitchA-Vlanif20] quit [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address 192.168.1.10 24 [SwitchA-Vlanif10] quit
- 配置RADIUS服务器模板。
# 创建RADIUS服务器模板controller。
[SwitchA] radius-server template controller
# 配置RADIUS认证密钥、主备用RADIUS服务器和计费服务器的IP地址、端口和主备运算法则。
[SwitchA-radius-controller] radius-server authentication 10.7.66.66 1812 weight 80 [SwitchA-radius-controller] radius-server accounting 10.7.66.66 1813 weight 80 [SwitchA-radius-controller] radius-server authentication 10.7.66.67 1812 weight 40 [SwitchA-radius-controller] radius-server accounting 10.7.66.67 1813 weight 40 [SwitchA-radius-controller] radius-server algorithm master-backup [SwitchA-radius-controller] radius-server shared-key cipher Example@123
# 配置自动探测功能。
[SwitchA-radius-controller] radius-server testuser username test1 password cipher abc@123
# 配置对状态为Down的RADIUS服务器的自动探测周期和探测报文的超时等待时间。(取值为缺省值)
[SwitchA-radius-controller] radius-server detect-server interval 60 [SwitchA-radius-controller] radius-server detect-server timeout 3
# 配置RADIUS认证请求报文的重传次数和周期。(取值为缺省值)
[SwitchA-radius-controller] radius-server retransmit 3 timeout 5 [SwitchA-radius-controller] quit
- 配置将RADIUS服务器标记为Down的条件。(取值为缺省值)
[SwitchA] radius-server dead-interval 5 [SwitchA] radius-server dead-count 2 [SwitchA] radius-server detect-cycle 2 [SwitchA] radius-server max-unresponsive-interval 300
- 配置认证方案、计费方案。
# 配置认证方案auth,认证模式为RADIUS认证。
[SwitchA] aaa [SwitchA-aaa] authentication-scheme auth [SwitchA-aaa-authen-auth] authentication-mode radius [SwitchA-aaa-authen-auth] quit
# 配置计费方案acc,计费模式为RADIUS计费。
[SwitchA-aaa] accounting-scheme acc [SwitchA-aaa-accounting-acc] accounting-mode radius [SwitchA-aaa-accounting-acc] quit
- 配置huawei域,在域下应用认证方案auth、计费方案acc、RADIUS服务器模板controller。
[SwitchA-aaa] domain huawei [SwitchA-aaa-domain-huawei] authentication-scheme auth [SwitchA-aaa-domain-huawei] accounting-scheme acc [SwitchA-aaa-domain-huawei] radius-server controller [SwitchA-aaa-domain-huawei] quit [SwitchA-aaa] quit
- 配置802.1X认证。
# 将NAC配置模式切换成统一模式。
设备默认为统一模式。传统模式与统一模式相互切换后,设备会自动重启。执行命令display authentication mode查看设备当前的NAC配置模式。
[SwitchA] authentication unified-mode
# 配置802.1X接入模板d1。[SwitchA] dot1x-access-profile name d1 [SwitchA-dot1x-access-profile-d1] quit
802.1X接入模板默认采用EAP中继认证方式。请确保RADIUS服务器支持EAP协议,否则无法处理802.1X认证请求。
# 配置认证模板绑定802.1X接入模板d1、指定认证模板下用户的强制域为huawei。
认证模板下配置强制域之后,使用该认证模板的用户,无论用户名是否携带域名或携带何种域名,均在该域下进行认证。
[SwitchA] authentication-profile name p1 [SwitchA-authen-profile-p1] dot1x-access-profile d1 [SwitchA-authen-profile-p1] access-domain huawei force [SwitchA-authen-profile-p1] quit
# 配置RADIUS服务器故障时的逃生权限和RADIUS服务器恢复后的重认证功能。以用户逃生时授权业务方案为例,其他授权信息的配置可参考(可选)配置认证事件授权信息。
[SwitchA] acl 3001 [SwitchA-acl-adv-3001] rule 1 permit ip source 192.168.2.0 0.0.0.255 [SwitchA-acl-adv-3001] quit [SwitchA] aaa [SwitchA-aaa] service-scheme s1 [SwitchA-aaa-service-s1] acl-id 3001 [SwitchA-aaa-service-s1] quit [SwitchA-aaa] quit [SwitchA] authentication-profile name p1 [SwitchA-authen-profile-p1] authentication event authen-server-down action authorize service-scheme s1 [SwitchA-authen-profile-p1] authentication event authen-server-up action re-authen [SwitchA-authen-profile-p1] quit
# 在接口GE0/0/2到GE0/0/n上绑定认证模板p1,使能802.1X认证。以接口GE0/0/2为例。
[SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] authentication-profile p1 [SwitchA-GigabitEthernet0/0/2] quit
- 检查配置结果。
# 在SwitchA上执行命令display radius-server configuration template template-name,查看RADIUS服务器模板controller的配置。
[SwitchA] display radius-server configuration template controller ------------------------------------------------------------------------------ Server-template-name : controller Protocol-version : standard Traffic-unit : B Shared-secret-key : ****** Group-filter : class Timeout-interval(in second) : 5 Retransmission : 3 EndPacketSendTime : 3 Dead time(in minute) : 5 Domain-included : Original NAS-IP-Address : - Calling-station-id MAC-format : xxxx-xxxx-xxxx Called-station-id MAC-format : XX-XX-XX-XX-XX-XX NAS-Port-ID format : New Service-type : - WLAN Called-station-id format : ap-mac:ssid NAS-IPv6-Address : :: Server algorithm : master-backup Detect-interval(in second) : 60 Detect up-server(in second) : 0 Detect timeout(in second) : 3 Testuser-username : test1 Testuser-ciperpwd : %^%#sn\dDprW4(}@sqUZGhg&8vMD4PatvD@H56)p7]7$%^%# Chargeable-user-identity : Not Support CUI Not reject : No Authentication Server 1 : 10.7.66.66 Port:1812 Weight:80 [up] Vrf:- LoopBack:NULL Vlanif:NULL Source IP: :: Authentication Server 2 : 10.7.66.67 Port:1812 Weight:40 [up] Vrf:- LoopBack:NULL Vlanif:NULL Source IP: :: Accounting Server 1 : 10.7.66.66 Port:1813 Weight:80 [up] Vrf:- LoopBack:NULL Vlanif:NULL Source IP: :: Accounting Server 2 : 10.7.66.67 Port:1813 Weight:40 [up] Vrf:- LoopBack:NULL Vlanif:NULL Source IP: :: ------------------------------------------------------------------------------
# 在SwitchA上执行命令display authentication-profile configuration name authentication-profile-name,查看RADIUS服务器模板p1的配置。
[SwitchA] display authentication-profile configuration name p1 Profile name : p1 Dot1x access profile name : d1 Mac access profile name : - Portal access profile name : - Free rule template : - Force domain : huawei Dot1x force domain : - Mac-authen force domain : - Portal force domain : - Default domain : - Dot1x default domain : - Mac-authen default domain : - Portal default domain : - Permit domain : - Authentication handshake : Enable Authentication handshake period : 300s Auth-fail re-auth period : 60s Pre-auth re-auth period : 60s Auth-fail aging time : 82800s Pre-auth aging time : 82800s Dot1x-mac-bypass : Disable Mac authen before 802.1x authen force : Disable Single-access : Disable Device-type authorize service-scheme : - Mac move detect enable : Enable Authentication mode : multi-authen Authen-fail authorize service-scheme : - Authen-server-down authorize service-scheme : s1 Pre-authen authorize service-scheme : - Security-name-delimiter : - Domain-name-delimiter : - Domain-location : - Domainname-parse-direction : - WLAN max user number : 128 Bound vap profile : - SVF flag : Disable Ip-static-user : Disable Roam-realtime-accounting : Disable Update-IP-realtime-accounting : Enable IP-address in-accounting-start : Disable IP-address arp-delay : Disable Update-session-mode : Disable Linkdown offline delay time : 10 Termination action : - Control direction : Inbound Update-Info-realtime-accounting : Enable Authentication roam pre-authen mac-authen : Disable
- 验证配置是否生效
在SwitchA与RADIUS服务器连接正常的情况下,在SwitchA在上执行命令display radius-server item template controller,查看RADIUS服务器的状态为Up状态(STState = STState-up)。
- 断开SwitchA与RADIUS服务器的连接,并且满足将RADIUS服务器的状态标记为Down的条件下,在SwitchA在上执行命令display radius-server item template controller,查看RADIUS服务器的状态为Down状态(STState = STState-down)。
- 在RADIUS服务器的状态为Down时,用户能够访问Internet。
配置文件
SwitchA的配置文件
# sysname SwitchA # vlan batch 10 20 # authentication-profile name p1 dot1x-access-profile d1 access-domain huawei force authentication event authen-server-down action authorize service-scheme s1 authentication event authen-server-up action re-authen # radius-server template controller radius-server shared-key cipher %^%#<1bHCyUgA+s\%jzV_Pwl`i1[e}HX=iRl1+qD+P%^%# radius-server authentication 10.7.66.66 1812 weight 80 radius-server authentication 10.7.66.67 1812 weight 40 radius-server accounting 10.7.66.66 1813 weight 80 radius-server accounting 10.7.66.67 1813 weight 40 radius-server testuser username test1 password cipher %^%#sn\dDprW4(}@sqUZGhg&8vMD4PatvD@H56)p7]7$%^%# # acl number 3001 rule 1 permit ip source 192.168.2.0 0.0.0.255 # aaa authentication-scheme auth authentication-mode radius accounting-scheme acc accounting-mode radius service-scheme s1 acl-id 3001 domain huawei authentication-scheme auth accounting-scheme acc radius-server controller # interface Vlanif10 ip address 192.168.1.10 255.255.255.0 # interface Vlanif20 ip address 192.168.2.10 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface GigabitEthernet0/0/2 port link-type access port default vlan 20 authentication-profile p1 # dot1x-access-profile name d1 # return