二、路由器网络服务安全配置
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
禁止从网络启动和自动从网络下载初始配置文件。
Router(Config)# no boot network
Router(Config)# no servic config
6、禁止IP Source Routing。
Router(Config)# no ip source-route
7、建议如果不需要ARP-Proxy服务则禁止它,路由器默认识开启的。
Router(Config)# no ip proxy-arp
Router(Config-if)# no ip proxy-arp
8、明确的禁止IP Directed Broadcast。
Router(Config)# no ip directed-broadcast
9、禁止IP Classless。
Router(Config)# no ip classless
10、禁止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
11、建议禁止SNMP协议服务。在禁止时必须删除一些SNMP服务的默认配置。或者需要访问列表来过滤。如:
Router(Config)# no snmp-server community ro
Router(Config)# no snmp-server community rw
三、路由器防止攻击的安全配置
1、TCP SYN的防范。如:
A: 通过访问列表防范。
Router(Config)# no access-list 106
Router(Config)# access-list 106 permit tcp any 192.168.0.0 0.0.0.255 established
Router(Config)# access-list 106 deny ip any any log
Router(Config)# interface eth 0/2
Router(Config-if)# description “external Ethernet”
Router(Config-if)# ip address 192.168.1.254 255.255.255.0
Router(Config-if)# ip access-group 106 in
B:通过TCP截获防范。
Router(Config)# ip tcp intercept list 107
Router(Config)# access-list 107 permit tcp any 192.168.0.0 0.0.0.255
Router(Config)# access-list 107 deny ip any any log
Router(Config)# interface eth0
Router(Config)# ip access-group 107 in
2、LAND.C 进攻的防范。
Router(Config)# access-list 107 deny ip host 192.168.1.254 host 192.168.1.254 log
Router(Config)# access-list permit ip any any
Router(Config)# interface eth 0/2
Router(Config-if)# ip address 192.168.1.254 255.255.255.0
Router(Config-if)# ip access-group 107 in
3、Smurf攻击的防范。
Router(Config-if)#no ip directed-broadcast
Router(Config)# access-list 108 deny ip any host 192.168.1.255 log
Router(Config)# access-list 108 deny ip any host 192.168.1.0 log
4、ICMP协议的安全配置。对于进入ICMP流,我们要禁止ICMP协议的ECHO、Redirect、Mask request。也需要禁止TraceRoute命令的探测。对于流出的ICMP流,我们可以允许ECHO、Parameter Problem、Packet too big。还有TraceRoute命令的使用。
! outbound ICMP Control
Router(Config)# access-list 110 deny icmp any any echo log
Router(Config)# access-list 110 deny icmp any any redirect log
Router(Config)# access-list 110 deny icmp any any mask-request log
Router(Config)# access-list 110 permit icmp any any
! Inbound ICMP Control
Router(Config)# access-list 111 permit icmp any any echo
Router(Config)# access-list 111 permit icmp any any Parameter-problem
Router(Config)# access-list 111 permit icmp any any packet-too-big
Router(Config)# access-list 111 permit icmp any any source-quench
Router(Config)# access-list 111 deny icmp any any log
! Outbound TraceRoute Control
Router(Config)# access-list 112 deny udp any any range 33400 34400
! Inbound TraceRoute Control
Router(Config)# access-list 112 permit udp any any range 33400 34400
5.DDoS(Distributed Denial of Service)的防范。
! The TRINOO DDoS system
Router(Config)# access-list 113 deny tcp any any eq 27665 log
Router(Config)# access-list 113 deny udp any any eq 31335 log
Router(Config)# access-list 113 deny udp any any eq 27444 log
! The Stacheldtraht DDoS system
Router(Config)# access-list 113 deny tcp any any eq 16660 log
Router(Config)# access-list 113 deny tcp any any eq 65000 log
! The TrinityV3 System
Router(Config)# access-list 113 deny tcp any any eq 33270 log
Router(Config)# access-list 113 deny tcp any any eq 39168 log
! The SubSeven DDoS system and some Variants
Router(Config)# access-list 113 deny tcp any any range 6711 6712 log
Router(Config)# access-list 113 deny tcp any any eq 6776 log
Router(Config)# access-list 113 deny tcp any any eq 6669 log
Router(Config)# access-list 113 deny tcp any any eq 2222 log
Router(Config)# access-list 113 deny tcp any any eq 7000 log
时间: 2004-12-5 13:17
作者: enuoCM
四、路由器防止病毒的安全配置
1、 用于控制Nachi蠕虫的扫描
access-list 110 deny icmp any any echo
2、用于控制Blaster蠕虫的传播
access-list 110 deny tcp any any eq 4444
access-list 110 deny udp any any eq 69
3、用于控制Blaster蠕虫的扫描和攻击
access-list 110 deny tcp any any eq 135
access-list 110 deny udp any any eq 135
access-list 110 deny tcp any any eq 139
access-list 110 deny udp any any eq 139
access-list 110 deny tcp any any eq 445
access-list 110 deny udp any any eq 445
access-list 110 deny tcp any any eq 593
access-list 110 deny udp any any eq 593
4、用于控制 Slammer 蠕虫的传播
access-list 110 deny udp any any eq 1434
access-list 110 permit ip any any
5、关闭可能存在的漏洞
access-list 101 deny ip 127.0.0.0 0.255.255.255 any
access-list 101 deny ip 172.16.0.0 0.240.255.255 any
access-list 101 deny ip 192.168.0.0 0.0.255.255 any
access-list 101 deny icmp any any echo-reply ! 拒绝任何应答
access-list 101 deny icmp any any host-unreachable ! 拒绝任何无法接通的主机
access-list 101 deny udp any any eq snmp ! 拒绝引入的SNMP
access-list 101 deny udp any eq 2000 ! 拒绝引入的openwindows
access-list 101 deny udp any any gt 6000 ! 拒绝引入的X-windows
access-list 101 deny tcp any any eq 2000 ! 拒绝引入的openwindows
access-list 101 deny tcp any any gt 6000 ! 拒绝引入的X-windows
access-list 101 deny udp any any eq 69 ! 拒绝引入的tftpd
access-list 101 deny udp any any eq 111 ! 拒绝引入的SunRPC
access-list 101 deny udp any any eq 2049 ! 拒绝引入的NFS
access-list 101 deny tcp any any eq 111 ! 拒绝引入的SunRPC
access-list 101 deny tcp any any eq 2049 ! 拒绝引入的 NFS
access-list 101 deny tcp any any eq 87 ! 拒绝引入的连接
access-list 101 deny tcp any any eq 512 ! 拒绝引入的 BSD UNIX “r”指令
access-list 101 deny tcp any any eq 513 ! 拒绝引入的 BSD UNIX “r”指令
access-list 101 deny tcp any any eq 514 ! 拒绝引入的 BSD UNIX “r”指令
access-list 101 deny tcp any any eq 515 ! 拒绝引入的 lpd
access-list 101 deny tcp any any eq 540 ! 拒绝引入的 uucpd
access-list 101 deny pim any any
access-list 101 deny 55 any any
access-list 101 deny 77 any any
access-list 101 deny 225 any any
access-list 101 deny udp any any eq 1434
access-list 101 deny udp any any eq 4672
access-list 101 deny tcp any any eq 445
access-list 101 deny tcp any any eq 5800
access-list 101 deny tcp any any eq 5900
access-list 101 deny udp any any eq 135
access-list 101 deny udp any any eq 445
access-list 101 deny udp any any eq 593
access-list 101 deny udp any any eq 53
access-list 101 deny tcp any any eq 135
access-list 101 deny tcp any any eq 139
access-list 101 deny tcp any any eq 42
access-list 101 deny udp any any eq netbios-ss
access-list 101 deny udp any any eq netbios-ns
access-list 101 deny tcp any any eq 593
access-list 101 deny tcp any any eq 3333
access-list 101 deny udp any any eq 4444
access-list 101 permit ip any any