21.3.2 路由器安全增强技术方法

2025-06-22 14:55:41 更新

(一)增强方法


方法

说明

1

及时升级系统和打补丁

及时升级路由器IOS操作系统能有效修补漏洞,获取新功能并提高性能

2

关闭不需要网络服务

路由器提供的BOOTP、Finger、NTP、Echo、Discard、Chargen、CDP等网络服务会造成安全隐患,建议关闭(参见下文)

3

明确禁止不使用端口

Router(Config) # interface eth 0/3

Router(Config) # shutdown

4

禁止IP直接广播和源路由

在路由器网络接口上禁止IP直接广播,防止smurf攻击

router# interface eth 0/0

router# no ip directed-broadcast

为防止攻击利用路由器的源路由功能,也应禁止使用

router# no ip source-route

5

增强路由器VTY安全

路由器给用户提供虚拟终端(VTY)访问,用户使用Telnet远程操作路由器

为保护路由器虚拟终端安全使用,要求用户必须提供口令认证,且限制访问网络区域或主机

6

阻断恶意数据包

路由器利用访问控制来禁止恶意数据包通行

常见恶意包:

源地址声称来自内网;

loopback包;

ICMP重定向包;

广播包;

源地址和目标地址相同

7

路由器口令安全

路由器口令存放应是密文。

在路由器配置时,使用Enable secret命令保存口令密文

Router# Enable secret 2Many-Routes-4-U

8

传输加密

启用路由器IPSec功能,对路由器之间传输信息加密。

借助IPSec,路由器支持建立虚拟专用网(VPN),在公共IP网络上确保数据通信保密性

9

增强路由器SNMP安全

修改路由器设备厂商SNMP默认配置,设置好public和private验证字(安全、不易猜测)

(二)关闭危险服务


操作方法

实例

1

禁止CDP (Cisco Discovery Protocol)

Router (Config) #no cdp run

Router (Config-if) # no cdp enable

2

禁止其他的TCP、UDP Small服务

Router (Config) # no service tcp-small-servers

Router (config) # no service udp-small-servers

3

禁止Finger 服务

Router (Config) # no ip finger

Router (Config) # no service finger

4

禁止HTTP服务

Router (Config) # no ip http server

5

禁止 BOOTP服务

Router (Config) #no ip bootp server

6

禁止从网络启动和自动从网络下载初始配置文件

Router (Config) # no boot network

Router (Config) # no service config

7

禁止IP Source Routing

Router (Config) # no ip source-route

8

禁止ARP-Proxy服务

Router (Config) # no ip proxy-arp

Router (Config-if) # no ip proxy-arp

9

禁止IP Directed Broadcast

Router (Config) # no ip directed-broadcast

10

禁止IP Classless

Router (Config) # no ip classless

11

禁止ICMP协议的IP Unreachables、Redirects、Mask Replies

Router (Config-if) # no ip unreacheables

Router (Config-if) # no ip redirects

Router (Config-if) # no ip mask-reply

12

禁止SNMP协议服务

Router (Config) # no snmp-server community public Ro

Router (Config) # no snmp-server community admin RW

Router (Config) # no access-list 70

Router (Config) # access-list 70 deny any

Router (Config) # snmp-server community MoreHardPublic Ro 70

Router (Config) # no snmp-server enable traps

Router (Config) # no snmp-server system-shutdown

Router (Config) # no snmp-server trap-anth

Router (Config) # no snmp-server

Router (Config) # end

13

禁止WINS 和 DNS服务

Router (Config) # no ip domain-lookup

(三)增强路由器VTY安全

路由器South安全设置

South(config) # line vty o 4

South(config-line) # login

South(config-line) # password soda-4-J1MMTY

South(config-iine) # access-class 2 in

South(config-line) # transport input telnet

South(config-line) # exit

South(config) # no access-list 92

South(config) # access-list 92 permit X.Y.Z.0 0.0.0.255

(四)阻断恶意数据包

North(config) # no access-list 107

North(config) # !biock internal addresses coming from outside

North(config) # access-iist 107 deny ip x.2.0.0 0.0.255.255 any log

North(config) # access-list 107 deny ip x.1.0.0 0.0.255.255 any log

North(config) # !block bogus loopback addresses

North(config) # access-list 107 deny ip 127.0.0.1 0.0.0.255 any log

North(config) # !block multicast

North(config) # access-list 107 deny ip 224.0.0.0 0.0.255.255 any

North(config) # !block broadcast

North(config) # access-list 107 deny ip host 0.0.0.0 any log

North(config) # !block ICMP redirects

North(config) # access-list 107 deny icmp any any redirect log

North(config) # interface eth0/0

North(config-if) # ip access-group 107 in