华为交换机对接tacacs配置示例

背景

客户需要对远程登陆账号进行统一管理,并且进行明确的权限限制,交换机本地认证权限无法明确区分且管理较为繁琐,radius认证也可以满足统一管理需求、但同样不便于对权限进行限制,因此提出需要使用hwtacacs进行对接。本次是使用NCE-Campus作为tacacs服务器。(同时Campus也可以作为portal、radisus服务器)

当交换机为Campus纳管时,tacacs相关配置可由控制器直接下发,本示例介绍的是未纳管场景交换机侧的配置。

配置

tacacs模板配置:

hwtacacs-server template hwtacacs 
 hwtacacs-server authentication 主tacacs 
 hwtacacs-server authentication 备tacacs secondary 
 hwtacacs-server authorization 主tacacs 
 hwtacacs-server authorization 备tacacs secondary
 hwtacacs-server accounting 主tacacs 
 hwtacacs-server accounting 备tacacs secondary 
 hwtacacs-server shared-key cipher 密码

授权模板:

aaa
authorization-scheme hwtacacs
 authorization-mode hwtacacs local
 authorization-cmd 0 hwtacacs local
 authorization-cmd 1 hwtacacs local
 authorization-cmd 2 hwtacacs local
 authorization-cmd 3 hwtacacs local
 authorization-cmd 4 hwtacacs local
 authorization-cmd 5 hwtacacs local
 authorization-cmd 6 hwtacacs local
 authorization-cmd 7 hwtacacs local
 authorization-cmd 8 hwtacacs local
 authorization-cmd 9 hwtacacs local
 authorization-cmd 10 hwtacacs local
 authorization-cmd 11 hwtacacs local
 authorization-cmd 12 hwtacacs local
 authorization-cmd 13 hwtacacs local
 authorization-cmd 14 hwtacacs local
 authorization-cmd 15 hwtacacs local

认证模板:

aaa
authentication-scheme hwtacacs
 authentication-mode hwtacacs local

计费模板:

aaa
accounting-scheme hwtacacs
 accounting-mode hwtacacs
 accounting realtime 3
 accounting start-fail online

域模板:

domain default_admin
 authentication-scheme hwtacacs
 accounting-scheme hwtacacs
 authorization-scheme hwtacacs
 hwtacacs-server hwtacacs

 结果验证

  1. 在交换机上执行display hwtacacs-server template tacacs_template,可以观察到该HWTACACS服务器模板的配置与要求一致。
  2. 在交换机上执行hwtacacs-user change-password hwtacacs-server tacacs_template命令或者display web-auth-server configuration命令时,提示授权失败。
  3. 在交换机上执行display authorization-scheme tacacs_autho_scheme,可以查看到级别为15的用户按命令行进行授权。
  4. 在交换机上执行display domain name admin.com,可以观察到该域的配置与要求一致。
  5. 登录控制器查看认证日志:在iMaster NCE-Campus选择策略 > 准入 > 诊断及日志 > 终端认证日志,选择“HWTACACS日志”,查看HWTACACS日志。
THE END