一些路由器交换机安全设置的总结

网络 路由交换
本文主要给大家详细的介绍了对于路由器和交换机之中的一些常见的设置问题,给出了在不同的VLAN接口上配置的的具体操作,相信看过此文对你有所帮助。

本文主要给大家详细的介绍了对于路由器交换机之中我们常用到的一些配置问题,并给出了详细的操作说明,希望看过此文之后对你有所帮助。

反向访问列表在交换技术中的应用方式

公司需求各个VLAN之间不能互相访问,但一些基本的应用不能受影响。假设有5个部门,就有5个VLAN,分别是管理(63)、办公(48)、业务(49)、财务(50)、其他(51)。

方法一: 只在管理VLAN的接口上配置,其它VLAN接口不用配置。

在入方向放置reflect
ip access-list extended infilter
permit ip any any reflect cciepass
在出方向放置evaluate
ip access-list extended outfilter
evaluate cciepass
deny ip 10.54.48.0 0.0.0.255 any
deny ip 10.54.49.0.0.0.0.255 any
deny ip 10.54.50.0 0.0.0.255 any
deny ip 10.54.51.0 0.0.0.255 any
permit ip any any

应用到管理接口
int vlan 63
ip access-group infilter in
ip access-group outfilter out

方法二:在管理VLAN接口上不放置任何访问列表,而是在其它VLAN接口都放。

以办公VLAN为例:

在出方向放置reflect
ip access-list extended outfilter
permit ip any any reflect cciepass

在入方向放置evaluate

ip access-list extended infilter
deny ip 10.54.48.0 0.0.0.255 10.54.49.0 0.0.0.255
deny ip 10.54.48.0 0.0.0.255 10.54.50.0 0.0.0.255
deny ip 10.54.48.0 0.0.0.255 10.54.51.0 0.0.0.255
deny ip 10.54.48.0 0.0.0.255 10.54.63.0 0.0.0.255
evaluate cciepass
permit ip any any

应用到办公VLAN接口:

int vlan 48
ip access-group infilter in
ip access-group outfilter out

IP欺骗得简单防护。如过滤非公有地址访问内部网络。过滤自己内部网络地址;回环地址(127.0.0.0/8);RFC1918私有地址;DHCP自定义地址(169.254.0.0/16);科学文档作者测试用地址(192.0.2.0/24);不用的组播地址(224.0.0.0/4);SUN公司的古老的测试地址(20.20.20.0/24;204.152.64.0/23);全网络地址(0.0.0.0/8)。

Router(Config)# access-list 100 deny ip 192.168.0.0 0.0.0.255 any log
Router(Config)# access-list 100 deny ip 127.0.0.0 0.255.255.255 any log
Router(Config)# access-list 100 deny ip 192.168.0.0 0.0.255.255 any log
Router(Config)# access-list 100 deny ip 172.16.0.0 0.15.255.255 any log
Router(Config)# access-list 100 deny ip 10.0.0.0 0.255.255.255 any log
Router(Config)# access-list 100 deny ip 169.254.0.0 0.0.255.255 any log
Router(Config)# access-list 100 deny ip 192.0.2.0 0.0.0.255 any log
Router(Config)# access-list 100 deny ip 224.0.0.0 15.255.255.255 any
Router(Config)# access-list 100 deny ip 20.20.20.0 0.0.0.255 any log
Router(Config)# access-list 100 deny ip 204.152.64.0 0.0.2.255 any log
Router(Config)# access-list 100 deny ip 0.0.0.0 0.255.255.255 any log

建议采用访问列表控制流出内部网络的地址必须是属于内部网络的。如:

Router(Config)# no access-list 101
Router(Config)# access-list 101 permit ip 192.168.0.0 0.0.0.255 any
Router(Config)# access-list 101 deny ip any any log
Router(Config)# interface eth 0/1
Router(Config-if)# description “internet Ethernet”
Router(Config-if)# ip address 192.168.0.254 255.255.255.0
Router(Config-if)# ip access-group 101 in

关闭路由器不需要的服务
在边界路由器上关闭不安全和不需要的服务,这里假设路由器有Ethernet0和Ethernet1端口
Router(config)#  no cdp run//关闭CDP协议,CDP使用多播地址,能够发现对端路由器的Hostname,硬件设备类型,IOS版本,三层接口地址,
发送CDP多播的地址

Router(config)#  no service tcp-small-servers
Router(config)#  no service udp-small-servers//关闭TCP和UDP的一些无用的小服务,这些小服务的端口小于19,通常用在以前的UNIX环境中,如chargen,daytime等
Router(config)#  no service finger//finger通常用在UNIX中,用来确定谁登陆到设备上:telnet 192.168.1.254 finger
Router(config)#  no ip finger//关闭对于finger查询的应答
Router(config)#  no ip identd//关闭用户认证服务,一个设备发送一个请求到Ident接口(TCP 113), 目标会回答一个身份识别,如host名称或者设备名称
Router(config)#  no ip source-route//关闭IP源路由,通过源路由,能够在IP包头中指定数据包实际要经过的路径
Router(config)#  no ftp-server enable//关闭FTP服务
Router(config)#  no ip http server//关闭HTTP路由器登陆服务
Router(config)#  no ip http secure-server//关闭HTTPS路由器登陆服务
Router(config)#  no snmp-server community public RO
Router(config)#  no snmp-server community private RW
Router(config)#  no snmp-server enable traps
Router(config)#  no snmp-server system-shutdown
Router(config)#  no snmp-server trap-auth
Router(config)#  no snmp-server//关闭SNMP服务
Router(config)#  no ip domain-lookup//关闭DNS域名查找
Router(config)#  no ip bootp server//bootp服务通常用在无盘站中,为主机申请IP地址
Router(config)#  no service dhcp//关闭DHCP服务
Router(config)#  no service pad//pad服务一般用在X.25网络中为远端站点提供可靠连接
Router(config)#  no boot network//关闭路由器通过TFTP加载IOS启动
Router(config)#  no service config//关闭路由器加载IOS成功后通过TFTP加载配置文件
Router(config)#  interface ethernet 0
Router(config -if)# no ip proxy-arp//关闭代理ARP服务
Router(config -if)# no ip directed-broadcast//关闭直连广播,因为直连广播是能够被路由的
Router(config -if)# no ip unreachable
Router(config -if)# no ip redirect
Router(config -if)# no ip mask-reply//关闭三种不可靠的ICMP消息
Router(config -if)# exit

注意:使用show ip interface查看接口启用的服务
Router(config)#  interface ethernet 0
Router(config -if)# shutdown//手动关闭没有使用的接口
Router(config -if)# exit
Router(config)#  service tcp-keepalives -in
Router(config)#  service tcp-keepalives -out
//对活动的tcp连接进行监视,及时关闭已经空闲超时的tcp连接,通常和telnet,ssh一起使用
Router(config)#  username admin1 privilege 15 secret geekboy
Router(config)#  hostname jwy
Bullmastiff(config)#  ip domain-name godupgod.com
Bullmastiff(config)#  crypto key generate rsa
Bullmastiff(config)#  line vty 0 4
Bullmastiff(config -line)# login local
Bullmastiff(config -line)# transport input ssh
Bullmastiff(config -line)# transport output ssh
//只允许其他设备通过SSH登陆到路由器

风暴控制

当端口接收到大量的广播、单播、多播时,就会发生广播风暴。转发这些包将导致网络速度变慢或超时。借助对端口的广播风暴控制,可以有效地避免硬件顺坏或链路故障而导致网络瘫痪。默认状态下,广播、多播和单播风暴控制被禁用。 配置实例:在快速以太网端口开启风暴控制,当网络广播包、多播包和单播包分别占到带宽10%、30%、50%时,即自动 关闭该端口。当宽带占用降低至9%、25%、45%时,再自动启用该端口,配置如下:

interface fastEthernet0/1
swithcport access vlan 2
no ip addres
storm-control broadcast level 10.00 9.00
strom-control multicast level 30.00 25.00
strom-control unicast level 50.00 45.00
strom-control action shutdown

其他要求风暴控制端口配置基本相同。
show storm-control unicast f0/1
storm-control broadcast level 50 30

当 广播到50%的时候,开始丢弃,并持续丢弃到 30%。30%以下开始正常转发。
如果不配置 30%, 那么 低于50% 就开始转发,高于50%就丢弃。
30% -50% 之间,你可以认为是 到达50%开始丢弃开始,到 低于30% 开始转发 之间的一个 继续丢弃的 “缓冲”区。
 

责任编辑:chenqingxiang 来源: itmop
相关推荐

2009-10-15 16:04:49

路由器变交换机

2009-11-17 17:15:21

路由器安全设置

2011-09-02 10:26:56

2009-11-27 09:44:21

Cisco路由器交换机

2017-06-01 14:33:04

交换机路由器网络设备

2009-12-23 14:07:10

路由器交换机设置

2009-12-03 11:43:30

路由器交换机区别

2009-11-25 13:07:53

2010-08-26 10:45:59

DHCP端口

2014-07-04 09:23:26

路由器交换机

2011-03-24 14:05:14

Nagios监控

2009-12-03 13:24:46

路由器交换机区别

2009-11-26 09:40:48

2013-01-28 10:13:27

交换机路由器路由功能

2018-07-31 10:09:06

2015-06-18 09:38:46

路由器交换机

2009-11-09 09:57:39

交换机路由器

2009-03-02 09:56:00

交换机集线器路由器

2010-01-13 10:08:14

交换机路由器

2010-01-12 09:38:24

华为路由器交换机
点赞
收藏

51CTO技术栈公众号