华为举例:配置主备服务器故障时用户Portal认证逃生

华为举例:配置主备服务器故障时用户Portal认证逃生

组网需求

如图3-59所示,DeviceA作为某公司网络的接入设备,网络中部署了两台RADIUS/Portal服务器,公司内用户的认证方式为Portal+RADIUS认证,认证成功后能够访问Internet。现在,管理员希望在RADIUS/Portal服务器故障的情况下,用户能够进入逃生,逃生时的权限与认证成功后的权限一致;在RADIUS/Portal服务器故障恢复后,用户能够进行重认证,重新使用RADIUS服务器授权。

图3-59 配置主备服务器故障时用户Portal认证逃生组网图

本例中Interface1、Interface2分别代表10GE1/0/1、10GE1/0/2。


配置注意事项

本举例主要介绍DeviceA上的NAC相关配置,RADIUS/Portal服务器配置这里不做相关说明。

RADIUS服务器上配置的RADIUS认证和计费密钥需与设备上配置的RADIUS服务器的共享密钥一致。

设备默认出接口的IP地址作为向RADIUS服务器发送RADIUS报文时使用的源IP地址,该IP地址需与RADIUS服务器上配置的设备IP地址一致。用户可以在RADIUS服务器模板视图下,通过如下命令修改该IP地址:

执行命令radius-server authentication ip-address port source,配置RADIUS认证服务器,并指定与RADIUS认证服务器发送RADIUS报文时使用的源IP地址。

执行命令radius-server accounting ip-address port source,配置RADIUS计费服务器,并指定与RADIUS计费服务器发送RADIUS报文时使用的源IP地址。

Portal服务器上配置的Portal密钥、端口号需与设备上配置的共享密钥、设备侦听Portal协议报文的端口号一致。


设备默认出接口的IP地址作为向Portal服务器发送Portal报文时使用的源IP地址,该IP地址需与Portal服务器上配置的设备IP地址一致。用户可以在Portal服务器模板视图下,通过命令source-interface或source-ip修改该IP地址。

测试单个用户触发RADIUS服务器Down方法。

[DeviceA] radius-server dead-interval 7

[DeviceA] radius-server dead-count 1

执行命令test-aaa四次后,RADIUS服务器Down。


配置思路

配置网络互连互通,使得设备之间路由可达。

配置AAA,对用户进行RADIUS认证、授权、计费。

配置Portal认证,并配置RADIUS/Portal服务器故障时的逃生权限,实现用户认证逃生功能。

操作步骤


配置网络互连互通。

# 创建VLAN并配置接口允许通过的VLAN、IP地址。

<HUAWEI> system-view

[HUAWEI] sysname DeviceA

[DeviceA] vlan batch 10 20

[DeviceA] interface 10ge 1/0/2

[DeviceA-10GE1/0/2] port link-type access

[DeviceA-10GE1/0/2] port default vlan 20

[DeviceA-10GE1/0/2] quit

[DeviceA] interface vlanif 20

[DeviceA-Vlanif20] ip address 192.168.2.10 24

[DeviceA-Vlanif20] quit

[DeviceA] interface 10ge 1/0/1

[DeviceA-10GE1/0/1] port link-type trunk

[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10

[DeviceA-10GE1/0/1] quit

[DeviceA] interface vlanif 10

[DeviceA-Vlanif10] ip address 192.168.1.10 24

[DeviceA-Vlanif10] quit

# 配置到RADIUS服务器的路由,假设下一跳为192.168.1.1。

[DeviceA] ip route-static 10.7.66.0 255.255.255.0 192.168.1.1


配置AAA。

# 创建RADIUS服务器模板rad1。

[DeviceA] radius-server template rad1

# 配置RADIUS认证密钥、主备用RADIUS服务器和计费服务器的IP地址、端口和主备运算法则。

[DeviceA-radius-rad1] radius-server authentication 10.7.66.66 1812 weight 80

[DeviceA-radius-rad1] radius-server accounting 10.7.66.66 1813 weight 80

[DeviceA-radius-rad1] radius-server authentication 10.7.66.67 1812 weight 40

[DeviceA-radius-rad1] radius-server accounting 10.7.66.67 1813 weight 40

[DeviceA-radius-rad1] radius-server algorithm master-backup

[DeviceA-radius-rad1] radius-server shared-key cipher YsHsjx_202206139


# 配置自动探测功能。

[DeviceA-radius-rad1] radius-server testuser username test1 password cipher YsHsjx_2022061

# 配置对状态为Down的RADIUS服务器的自动探测周期和探测报文的超时等待时间。(取值为缺省值)

[DeviceA-radius-rad1] radius-server detect-server interval 60

[DeviceA-radius-rad1] radius-server detect-server timeout 3

# 配置RADIUS认证请求报文的重传次数和周期。(取值为缺省值)

[DeviceA-radius-rad1] radius-server retransmit 3 timeout 5

[DeviceA-radius-rad1] quit

# 配置将RADIUS服务器标记为Down的条件。(取值为缺省值)

[DeviceA] radius-server dead-interval 5

[DeviceA] radius-server dead-count 2

[DeviceA] radius-server detect-cycle 2

[DeviceA] radius-server max-unresponsive-interval 300

# 配置认证方案auth,认证模式为RADIUS认证。

[DeviceA] aaa

[DeviceA-aaa] authentication-scheme auth

[DeviceA-aaa-authen-auth] authentication-mode radius

[DeviceA-aaa-authen-auth] quit

# 配置计费方案acc,计费模式为RADIUS计费。

[DeviceA-aaa] accounting-scheme acc

[DeviceA-aaa-accounting-acc] accounting-mode radius

[DeviceA-aaa-accounting-acc] quit

# 配置example域,在域下应用认证方案auth、计费方案acc、RADIUS服务器模板rad1。

[DeviceA-aaa] domain example

[DeviceA-aaa-domain-example] authentication-scheme auth

[DeviceA-aaa-domain-example] accounting-scheme acc

[DeviceA-aaa-domain-example] radius-server rad1

[DeviceA-aaa-domain-example] quit

[DeviceA-aaa] quit


配置Portal认证。

# 配置Portal服务器模板server1和server2。

[DeviceA] web-auth-server server1

[DeviceA-web-auth-server-server1] server-source ip-address 192.168.1.10  

[DeviceA-web-auth-server-server1] server-ip 10.7.66.66

[DeviceA-web-auth-server-server1] port 50200

[DeviceA-web-auth-server-server1] url http://10.7.66.66:8080/portal

[DeviceA-web-auth-server-server1] shared-key cipher YsHsjx_202206

[DeviceA-web-auth-server-server1] server-detect max-times 3 interval 60

[DeviceA-web-auth-server-server1] quit

[DeviceA] web-auth-server server2

[DeviceA-web-auth-server-server1] server-source ip-address 192.168.1.10  

[DeviceA-web-auth-server-server2] server-ip 10.7.66.67

[DeviceA-web-auth-server-server2] port 50200

[DeviceA-web-auth-server-server2] url http://10.7.66.67:8080/portal

[DeviceA-web-auth-server-server2] shared-key cipher YsHsjx_202206

[DeviceA-web-auth-server-server2] server-detect max-times 3 interval 60

[DeviceA-web-auth-server-server2] quit

# 配置Portal接入模板web1,使能主备Portal认证。

[DeviceA] portal-access-profile name web1

[DeviceA-portal-access-profile-web1] web-auth-server server1 server2

[DeviceA-portal-access-profile-web1] quit

#配置ACL。以下给出允许逃生用户访问所有网段和允许逃生用户访问部分网段的ACL配置示例。

允许逃生用户访问所有网段。

[DeviceA] acl 3001

[DeviceA-acl-adv-3001] rule 0 permit ip

[DeviceA-acl-adv-3001] quit

允许逃生用户访问部分网段。

[DeviceA] acl 3001

[DeviceA-acl-adv-3001] rule 1 permit ip destination 192.168.10.166 0

[DeviceA-acl-adv-3001] rule 2 permit ip destination 192.168.11.31 0

[DeviceA-acl-adv-3001] rule 3 permit ip destination 192.168.12.26 0

[DeviceA-acl-adv-3001] rule 4 deny ip     //该deny规则必须配置,表示除了以上rule 1、2、3放通的网段外,其他网段禁止访问。

[DeviceA-acl-adv-3001] quit

# 配置RADIUS服务器故障时的逃生权限。以用户逃生时授权业务方案为例,其他授权信息的配置可参考(可选)配置用户逃生。

[DeviceA] aaa

[DeviceA-aaa] service-scheme s1

[DeviceA-aaa-service-s1] acl-id 3001

[DeviceA-aaa-service-s1] quit

[DeviceA-aaa] quit

[DeviceA] authentication-profile name p1

[DeviceA-authen-profile-p1] authentication event authen-server-down action authorize service-scheme s1

[DeviceA-authen-profile-p1] quit

# 配置Portal服务器故障时的逃生权限和Portal服务器恢复后的重认证功能。以用户逃生时授权业务方案为例,其他授权信息的配置可参考(可选)配置Portal逃生功能。

[DeviceA] portal-access-profile name web1

[DeviceA-portal-access-profile-web1] authentication event portal-server-down action authorize service-scheme s1

[DeviceA-portal-access-profile-web1] authentication event portal-server-up action re-authen

[DeviceA-portal-access-profile-web1] quit

# 在认证模板上绑定Portal接入模板web1、指定认证模板下用户的强制认证域为example.com。

认证模板下配置强制域之后,使用该认证模板的用户,无论用户名是否携带域名或携带何种域名,均在该域下进行认证。

[DeviceA] authentication-profile name p1

[DeviceA-authen-profile-p1] portal-access-profile web1

[DeviceA-authen-profile-p1] access-domain example.com force

[DeviceA-authen-profile-p1] quit

# 在接口10GE1/0/2上绑定认证模板p1,使能Portal认证。用户接入的其他下行接口配置与之类似。

[DeviceA] interface 10ge 1/0/2

[DeviceA-10GE1/0/2] authentication-profile p1

[DeviceA-10GE1/0/2] quit


验证配置结果。

用户启动终端后,访问网络会触发重定向,用户在重定向出的页面中输入用户名和密码进入Portal认证。认证后,用户能够访问Internet。

在RADIUS/Portal服务器的状态为Down时,用户能够访问Internet。

主RADIUS服务器状态为Down时,通过备RADIUS服务器对用户授权,用户可以继续访问Internet。如果主备RADIUS服务器状态都为Down,用户进入逃生状态,可以访问指定的网络资源。主Portal服务器状态为Down时,通过备Portal服务器对用户认证。如果主备Portal服务器状态都为Down,用户进入逃生状态,可以访问指定的网络资源。

用户上线后,在DeviceA执行命令display access-user ip-address查看在线用户信息。

配置文件

DeviceA的配置文件
#
sysname DeviceA
#
vlan batch 10 20 
#
authentication-profile name p1
 authentication event authen-server-down action authorize service-scheme s1
 portal-access-profile web1
 access-domain example.com force
#
radius-server template rad1
 radius-server authentication 10.7.66.66 1812 weight 80
 radius-server accounting 10.7.66.66 1813 weight 80
 radius-server authentication 10.7.66.67 1812 weight 40
 radius-server accounting 10.7.66.67 1813 weight 40
 radius-server shared-key cipher %^%#b<4UC_J36%l@*;E]1\s6fJIY85mHu68SrhKtU%"B%^%#
 radius-server testuser username test1 password cipher %^%#O80v=d`~o>9:XXAS|o9'wrqD9hY+Q!El"EK:GT{G%^%#
#
web-auth-server server1
 server-source ip-address 192.168.1.10  
 server-ip 10.7.66.66
 port 50200
 url http://10.7.66.66:8080/portal
 shared-key cipher %^%#-;k-</gjVJ=ZK&Ea)<WB(j1FD8HJOGq^@$Ly=\0Y%^%#
 server-detect max-times 3 interval 60
web-auth-server server2
 server-source ip-address 192.168.1.10   
 server-ip 10.7.66.67
 port 50200
 url http://10.7.66.67:8080/portal
 shared-key cipher %^%#S/:6+:&#J0Sj|H:P2"MOcOh<!DZqX'kF.uSH'~Q'%^%#
 server-detect max-times 3 interval 60
#
portal-access-profile name web1
 web-auth-server server1 server2 
 authentication event portal-server-down action authorize service-scheme s1
 authentication event portal-server-up action re-authen
#
interface 10GE 1/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
#
interface 10GE 1/0/2
 port link-type access
 port default vlan 20
 authentication-profile p1
#
interface vlanif 10
 ip address 192.168.1.10 255.255.255.0
#
interface vlanif 20
 ip address 192.168.2.10 255.255.255.0
#
acl 3001
 rule 0 permit ip
#
aaa
 authentication-scheme auth
  authentication-mode radius
 accounting-scheme acc
  accounting-mode radius
 service-scheme s1
  acl-id 3001
 domain example
  authentication-scheme auth
  accounting-scheme acc
  radius-server rad1
#
ip route-static 10.7.66.0 255.255.255.0 192.168.1.1
#
return


1、本站资源长期持续更新。
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。

转载请保留出处:  www.zh-cjh.com珠海陈坚浩博客 » 华为举例:配置主备服务器故障时用户Portal认证逃生

作者: 小编


手机扫一扫,手机上查看此文章:

一切源于价值!

其他 模板文件不存在: ./template/plugins/comment/pc/index.htm

未雨绸缪、居安思危!

数据安全、有备无患!

注意操作、数据无价!

一切源于价值!