1、用SSH替代Telnet

    

R2(config)#ip domain-name test.com
R2(config)#crypto key generate rsa
The name for the keys will be: R2.test.com
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]:
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

R2(config)#username test password cisco
R2(config)#line vty
R2(config)#line vty 0 4
R2(config-line)#transport input ssh
R2(config-line)#login local
R2(config-line)#exit

2、记录日志

Router#terminal monitor        用telnet打开路由器打开日志
Router#terminal no monitor     关闭
R1(config)#logging buffered <0-7>    发送消息到缓存<0-7>等级

3、禁用不需要的服务或端口

no cdp run     关闭CDP协议

no ip http server 关闭HTTP服务

R#auto secure no-interact 自动优化网络安全

4、SDM

SDM(Security Device Manager,安全设备管理)是基于Cisco IOS Software的路由器开发的一种直观的Web设备管理工具。

R2(config)#ip http server                开启http服务

    配置路由器支持SDM

R2(config)#ip http server                                    开启http服务
R2(config)#ip http authentication local                      开启本地验证
R2(config)#username test privilege 15 password cisco         配置本地用户名和密码


5、密码恢复

console口连路由器,开机时,按Ctrl+Break,进入rommon模式。

rommon 2 > confreg 0x2142
rommon 3 > reset
Router>en
Router#copy startup-config running-config
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#enable secret cisco
R1(config)#config-register 0x2102
R1(config)#write
R1(config)#exit
R1#write
R1#reload