实验过程: 第一步:通过console线缆,使用超级终端或者SecureCRT登录路由器,完成基本配置,同时将交叉线连接到路由器E1/0,t在PC的接口上配置IP为192.168.10.1,掩码255.255.255.0
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no ip domain-lookup
Router(config)#line console 0
Router(config-line)#no exec-t
Router(config-line)#logg syn
3640(config)#host R3640
R3640(config)#int e1/0
R3640(config-if)#ip add 192.168.10.3 255.255.255.0
R3640(config-if)#no sh
R3640(config-if)#end
*Mar 1 00:02:02.499: %SYS-5-CONFIG_I: Configured from console by console
R3640#ping 192.168
*Mar 1 00:02:03.659: %LINK-3-UPDOWN: Interface Ethernet1/0, changed state to up
*Mar 1 00:02:04.659: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to up
R3640#ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds: .!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 12/32/44 ms
第二步:启用AAA,并配置登录验证为local
R3640#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3640(config)#aaa ?
new-model Enable NEW access control commands and functions.(Disables OLD
commands.)
R3640(config)#aaa new-model全局启用AAA功能
R3640(config)#aaa authentication login ?当用户登录时启用AAA认证功能,并且定义认证时调用的名字是默认的”default”,还是自己随便定义1个
WORD Named authentication list.
default The default authentication list.
R3640(config)#aaa authentication login default ?指定用哪种认证方式
enable Use enable password for authentication. 使用特权密码
group Use Server-group 使用Radius或者Tacacs+协议
krb5 Use Kerberos 5 authentication. 使用Kerberos
krb5-telnet Allow logins only if already authenticated via Kerberos V
Telnet.
line Use line password for authentication. 使用线路认证方式
local Use local username authentication.使用本地认证方式,需配置用户名和密码
local-case Use case-sensitive local username authentication.
none NO authentication. 不做认证 配置当用户登录设备时,使用aaa本地登录认证方式,认证调用的名字为default,认证方式为local
R3640(config)#aaa authentication login default local 配 置本地登录时,使用的用户名和密码。密码我配置的为经过MD5加密的secret密码。安全性高,在show running-config显示的是密文的。不建议配置明文的用户名和密码如(R3640(config)#username admin password admin) 密码建议配置复杂一点,要有大小写,特殊字符,和数字,长度大于8位以上。如:P@ssw0rd
R3640(config)#username nousername secret nopassword 第三步:启用认证调试,观察debug 现象
R3640#debug aaa authentication
AAA Authentication debugging is on
R3640# 第四步:如图1所示,在PC上使用telnet,远程登录路由器