(一)设备访问方式
(1)带外(out-of-band)访问不依赖其他网络
(2)带内(in-band)访问要求提供网络支持
(二)设备访问方法
访问方法 | 说明 | ||
1 | line | Console Port | 默认设置,要求物理上访问网络设备 |
2 | AUX Port | 提供带外访问,可通过终端服务器或调制解调器Modem连接到网络设备,支持远程访问 | |
3 | VTY | 提供终端模式通过网络访问网络设备,通常协议是Telnet或SSH2。 VTY数量一般设置为5个,编号是0到4 | |
4 | HTTP | 网络设备进行Web访问 | |
5 | TFTP | (Trivial File Transfer Protocol)网络设备上传配置文件 | |
6 | SNMP | 提供读或读写访问几乎所有网络设备 |
(三)访问控制配置
(1)CON端口访问(限制特定主机X.Y.Z.1访问)
Router(Config)# Access-list 1 permit X.Y.Z.1
Router(config)# line con 0
// 配置console端口0
Router(Config-line)# Transport input none
// 允许远程连接的协议
Router(Config-line)# Login local
// 调用本地数据库登录(账密)
Router(Config-line)# Exec-timeoute 5 0
// 无操作时5分0秒后断开
Router(Config-line)# access-class 1 in
// 线路模式下采用定义的标准ACL 1 in 进入的方向上生效
Router(Config-line)# end
(2)VTY访问控制(指定固定IP地址才能访问)
Router# config terminal
Enter configuration commands,one per line. End with CTRL/Z.
Router(config)# access-list 10 permit X.Y.Z.12
Router(config)# access-list 10 permit X.Y.Z.5
Router(config)# access-list 10 deny any
Router(config)# line vty 0 4
Router(config-line)# access-class 10 in
Router(config-line)# ^Z
Router#
超时限制配置
Router# config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# service tcp-keepalives-in
Router(config)# line vty 0 4
Router(config-line)# exec-timeout 5 0
Router(config-line)# ^Z
Router#
(3)HTTP访问控制(限制指定IP地址才能访问)
Router# config terminal
Enter configuration commands,one per line. End with CTRL/Z.
Router(config)# access-list 20 permit X.Y.Z.15
Router(config)# access-list 20 deny any
Router(config)# ip http access-class 20
Router(config)# ^Z
Router#
强化HTTP认证配置(type=enable|local|tacacs|aaa)
Router# config terminal
Enter configuration commands,one per line. End with CTRL/Z.
Router(config)# ip http authentication type
# type为enable、local、tacacs或aaa
Router(config)# ^Z
Router#
(4)SNMP访问控制
● SNMP访问认证
①设置只读SNMP访问模式的社区字符串
Router# config terminal
Enter configuration commands,one per line. End with CNTL/Z.
Router(config)# snmp-server community UnGuessablestringReadonly RO
# read only
Router(config)# ^Z
②设置读/写SNMP访问模式的社区字符串
Router# config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# snmp-server community UnGuessablestringwriteable RW
Router(config)# ^Z
● 限制访问IP地址
Router# config terminal
Enter configuration commands,one per line. End with CNTL/Z.
Router(config)# access-list 6 permit X.Y.Z.8
Router(config)# access-list 6 permit X.Y.Z.7
Router(config)# access-list 6 deny any
Router(config)# snmp-server community UnGuessablestringReadonly RO 6
Router(config)#^Z
● 关闭SNMP访问
Router# config terminal
Enter configuration commands,one per line. End with CNTL/Z.
Router(config)# no snmp-server community UnGuessablestringReadonly RO
Router(config)# ^Z
(5)设置管理专网
- 远程访问路由器一般通过路由器自身提供的网络服务来实现。如Telnet、SNMP、Web服务或拨号服务
- 远程通信时信息是明文,为增强远程访问的安全性,应建立一个专用网络用于管理设备
网络安全配置
- 将管理主机和路由器之间的全部通信加密,使用SSH替换Telnet。
- 在路由器设置包过滤规则,只允许管理主机远程访问路由器
Router(config)# access-list 99 permit X.Y.Z.6 log
Router(config)# access-list 99 deny any log
Router(config)# line vty 0 4
// 配置vty线路0-4
Router(config-line)# access-class 99 in
// 线路模式下采用标准ACL 99
Router(config-line)# exec-timeout 5 0
// 无操作时5分0秒后断开
Router(config-line)# login local
// 调用本地数据库登录(账密)
Router(config-line)# transport input telnet
// 允许远程连接的协议
Router(config-line)# exec
Router(config-line)# end
Router#
(6)特权分级
针对交换机、路由器潜在操作安全风险,提供权限分级机制,每种权限级别对应不同操作能力。
Cisco网络设备将权限分为0-15共16个等级:
0最低,15最高。等级越高,操作权限就越多
Router> show privilege
current privilege level is 1
Router> enable 5
Password: level-5-password
Router# show privilege
current privilege level is 5
Router#