local(本地认证)放在认证方法的最后。这样即使所有 TACACS 服务器(主和备)都宕机,你依然可以使用交换机本地创建的管理员账号登录设备进行救急。track 功能,配置对 TACACS 服务器 IP 的 ICMP 或 TCP 端口探测。当 Track 检测到服务器不可达时,自动从 AAA 方案中剔除该服务器。1# 1. 创建 HWTACACS 方案并配置主备服务器
2hwtacacs scheme tacacs_main
3 # 配置主、备服务器IP(默认端口49)
4 primary authentication 192.168.10.10
5 secondary authentication 192.168.10.20
6 # 配置共享密钥
7 key authentication simple YourSecretKey
8 # 【最佳实践】缩短超时时间为3秒,重试次数为2次
9 timer response 3
10 retry 2
11 quit
12
13# 2. 配置本地逃生账号(防止AAA服务器全挂导致无法登录)
14local-user admin_bypass class manage
15 password simple YourLocalPassword
16 service-type ssh telnet terminal
17 authorization-attribute user-role network-admin
18 quit
19
20# 3. 配置 AAA 认证方案,并将 local 放在最后
21domain manage_domain
22 # 认证顺序:先 HWTACACS,如果服务器无响应或拒绝,最后尝试本地认证
23 authentication login hwtacacs-scheme tacacs_main local
24 authorization login hwtacacs-scheme tacacs_main local
25 quit
26
27# 4. 将域应用到登录线路(如 SSH/Telnet)
28line vty 0 63
29 authentication-mode scheme
30 domain manage_domain
31 quitlocal 本地认证,这是保障网络设备管理通道不中断的底线。暂无评论
tacacs-server enable health-check 默认 不开启system-view
# 1. 全局启用 TACACS 健康检测
tacacs-server enable health-check
# 2. 探测参数(推荐值)
# interval:探测间隔 30 秒
# timeout:超时 5 秒
# retry:重试 2 次
tacacs-server health-check interval 30
tacacs-server health-check timeout 5
tacacs-server health-check retry 2
# 3. 创建 HWTACACS 方案
hwtacacs scheme TAC
# 主服务器
primary authentication 10.1.1.1 49
primary authorization 10.1.1.1 49
primary accounting 10.1.1.1 49
# 备服务器
secondary authentication 10.1.1.2 49
secondary authorization 10.1.1.2 49
secondary accounting 10.1.1.2 49
# 密钥(和服务器一致)
key authentication simple YourKey123
key authorization simple YourKey123
key accounting simple YourKey123
# 用户名不带域名
user-name-format without-domain
quit
# 4. 新建或修改 ISP 域
domain system
scheme hwtacacs-scheme TAC
# 认证失败/服务器不可达时,允许本地密码登录
authentication local
authorization local
accounting local
quit
user-interface vty 0 15
authentication-mode scheme
quit
save
# 查看健康检测全局配置
display tacacs-server health-check
# 查看 HWTACACS 服务器状态(Active/Block)
display hwtacacs scheme TAC
# 查看探测统计
display hwtacacs statistics暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论