1. login 用户使用本地认证
    1. 组网需求
    对所有类型 login 用户进行本地认证,但不要求计费。
    2. 组网图
     
    3. 配置步骤
    # 使能AAA。
    [Router] aaa-enable
    # 配置Login 用户
    [Router] local-user ftp service-type ftp password simple ftp
    [Router] local-user admin service-type administrator ssh password cipher admin
    [Router] local-user operator service-type operator ssh password simple operator
    [Router] local-user guest service-type guest ssh password simple guest
    # 配置对login 用户进行认证。
    [Router] aaa authentication-scheme login default local
    [Router] login-method authentication-mode con default
    [Router] login-method authentication-mode async default
    [Router] login-method authentication-mode hwtty default
    [Router] login-method authentication-mode pad default
    [Router] login-method authentication-mode telnet default
    [Router] login-method authentication-mode ssh default
    # 配置对FTP 用户进行认证。
    [Router] login-method authentication-mode ftp default
    # 配置对login 用户不计费。
    [Router] undo login-method accounting-mode login con
    [Router] undo login-method accounting-mode login async
    [Router] undo login-method accounting-mode login hwtty
    [Router] undo login-method accounting-mode login pad
    [Router] undo login-method accounting-mode login telnet
    [Router] undo login-method accounting-mode login ssh
  2. 对PPP 用户、login 用户、FTP 用户使用本地认证
    1. 组网需求
    使用路由器本地数据库对从 Serial0 接口拨号接入的PPP 用户进行本地认证。
    本地验证不支持计费。
    2. 组网图
     
3. 配置步骤
# 使能AAA,配置PPP 用户的缺省认证方法列表。
[Router] aaa-enable
[Router] aaa authentication-scheme ppp default local
# 配置对从Serial0 接口拨号PPP 用户进行认证、无需授权、无需计费。
[Router] interface serial 0
[Router-serial0] ppp authentication-mode pap scheme default
[Router-serial0] undo ppp authorization-mode
[Router-serial0] undo ppp accounting-mode
[Router-serial0] quit
# 配置本地PPP 用户。
[Router] local-user ppp-user service-type ppp password simple ppp

对PPP 用户使用RADIUS 进行认证

1. 组网需求
使用 RADIUS 服务器进行认证,129.7.66.66 作为第一个认证和计费服务器,
129.7.66.67 作为第二个认证和计费服务器,两个服务器都采用默认的认证端口号
1812 和计费端口号1813。
2. 组网图
 
3. 配置步骤
# 使能AAA,配置PPP 用户的缺省认证方法列表。
[Router] aaa-enable
[Router] aaa authentication-scheme ppp default radius
# 配置RADIUS 服务器IP 地址和端口。
[Router] radius server 129.7.66.66
[Router] radius server 129.7.66.67
# 配置RADIUS 服务器密钥、重传次数及计费选项。
[Router] radius shared-key my-secret
[Router] radius retry 2
[Router] radius timer response-timeout 5
[Router] aaa accounting-scheme optional

使用HWTACACS 进行认证、授权和计费
1. 组网需求
对 PPP 用户和login 用户使用HWTACACS 进行认证、授权和计费。
2. 组网图
 
3. 配置步骤
# 使能AAA。
[Router]aaa-enable
# 配置HWTACACS。
# 创建HWTACACS 服务器组,并向其中加入HWTACACS 服务器。
[Router] hwtacacs-server template tactemplate1
[Router-hwtacacs-tactemplate1]host ip 10.110.1.1 authen-primary
[Router-hwtacacs-tactemplate1]host ip 10.110.1.1 author-primary
[Router-hwtacacs-tactemplate1]host ip 10.110.1.1 account-primary
[Router-hwtacacs-tactemplate1]host ip 10.110.1.2
# 配置与HWTACACS 服务器进行AAA 协商时的加密密钥为“mykey”。
[Router-hwtacacs-tactemplate1]shared-key mykey
[Router-hwtacacs-tactemplate1] quit
# 配置对Telnet login 用户进行认证。
[Router]aaa authentication-scheme login login-authen-list template  tactemplate1
[Router]login-method authentication-mode telnet login-authen-list
# 配置对Serial0 接口的PPP 用户进行认证。
[Router]aaa authentication-scheme ppp ppp-authen-list template tactemplate1
[Router]interface serial 0
[Router-Serial0] link-protocol ppp
[Router-Serial0] ppp authentication-mode pap scheme ppp-authen-list
[Router-serial0] quit
# 配置login 用户授权方法列表。
[Router]aaa authorization-scheme login login-author-list template  tactemplate1
# 配置login 用户应用授权方法列表。
[Router]login-method authorization-mode telnet login-author-list
# 在Serial0 接口上启动对PPP 用户授权并使用名为ppp-author-list 的授权方法列表:
[Router]aaa authorization-scheme ppp ppp-author-list template tactemplate1
[Router]interface serial 0
[Router-Serial0]link-protocol ppp
[Router-Serial0]ip address 168.1.1.1 255.255.255.0
[Router-Serial0]ppp authorization-mode ppp-author-list
[Router-serial0] quit
# 使能对login 用户进行计费并配置计费方法列表(account-list)。
[Router] aaa accounting-scheme login login-account-list template tactemplate1
# 配置telnet 的login 方式的计费采用login-account-list 方法列表:
[Router]login-method accounting-mode login telnet login-account-list
# 在Serial0 上使能计费,并使用ppp-account-list 的计费方法列表
[Router] aaa accounting-scheme ppp ppp-account-list template tactemplate1
[Router] interface serial 0
[Router-Serial0] link-protocol ppp
[Router-Serial0] ppp accounting-mode ppp-account-list
[Router-serial0] quit
# 配置Ethernet0 接口IP 地址。
[Router]interface ethernet 0
[Router-ethernet0]ip address 10.110.1.10 255.255.0.0
# 配置Ethernet1 接口IP 地址。
[Router-ethernet0]interface ethernet 1
[Router-ethernet0]ip address 192.10.1.1 255.255.255.0
[Router-ethernet0]return

HWTACACS 和RADIUS 组合应用
1. 组网需求
对 PPP 用户和login 用户使用HWTACACS 进行认证和授权,同时作为计费的备份服务器。使用RADIUS 进行计费,同时作为认证和授权的备份服务器。
2. 组网图
 
3. 配置步骤
# 使能AAA。
[Router]aaa-enable
# 配置HWTACACS。
# 创建HWTACACS 服务器组,并向其中加入HWTACACS 服务器。
[Router] hwtacacs-server template tactemplate1
[Router-hwtacacs-tactemplate1]host ip 10.110.1.1 authen-primary
[Router-hwtacacs-tactemplate1]host ip 10.110.1.1 author-primary
# 配置与HWTACACS 服务器进行AAA 协商时的加密密钥为“mykey”。
[Router-hwtacacs-tactemplate1]shared-key mykey
[Router-hwtacacs-tactemplate1] quit
# 配置RADIUS 服务器主机的IP 地址、认证端口号与计费端口号。
[Router]radius server 10.110.1.2
# 配置RADIUS 服务器密钥、重传次数及超时时间。
[Router] radius shared-key my-secret
[Router] radius retry 2
[Router] radius timer response-timeout 5
# 配置对Telnet login 用户进行认证。
[Router]aaa authentication-scheme login telnet-authen-list template tactemplate1 radius
[Router]login-method authentication-mode telnet telnet-authen-list
# 配置对Serial0 接口的PPP 用户进行认证。
[Router]aaa authentication-scheme ppp ppp-authen-list template tactemplate1
radius
[Router]interface serial 0
[Router-Serial0] link-protocol ppp
[Router-Serial0] ppp authentication pap scheme ppp-authen-list
[Router-serial0] quit
# 使能对login 用户进行授权并配置授权方法列表。
[Router]aaa authorization-scheme login login-author-list template
tactemplate1
# 配置telnet 用户login 类型应用授权方法列表。
[Router]login-method authorization-mode telnet login-author-list
# 在Serial0 接口上启动对PPP 用户授权并使用名为test-list 的授权方法列表:
[Router]aaa authorization-scheme ppp ppp-author-list template tactemplate1
[Router]interface serial 0
[Router-Serial0]link-protocol ppp
[Router-Serial0]ip address 168.1.1.1 255.255.255.0
[Router-Serial0]ppp authorization-mode ppp-author-list
[Router-serial0] quit
# 使能对login 用户进行计费并配置缺省的计费方法列表。
[Router] aaa accounting-scheme login default radius template tactemplate1
[Router] aaa accounting-scheme optional
# 配置telnet login 方式对login 的计费采用default 方法列表:
[Router]login-method accounting-mode login telnet default
# 在Serial0 上使能计费,配置并使用default 的计费方法列表
[Router] aaa accounting-scheme ppp default radius template tactemplate1
[Router]interface Serial0
[Router-Serial0]link-protocol ppp
[Router-Serial0]ppp accounting-mode default
[Router-serial0] quit
# 配置Ethernet0 接口IP 地址。
[Router]interface ethernet 0
[Router-ethernet0]ip address 10.110.1.10 255.255.0.0
# 配置Ethernet1 接口IP 地址。
[Router-ethernet0]interface ethernet 1
[Router-ethernet0]ip address 192.10.1.1 255.255.255.0