1、10修改设备网络标签81 IOS版本升级 确保设备操作系统软件版本及时更新,软件版本较低会带来安全性和稳定性方面的隐患,因此要求在设备的FLASH容量允许的情况下升级到较新的版本。必要情况下可升级设备的FLASH容量。 确保所有的网络设备维护在本地进行。 对于允许远程登陆管理的网络设备,必须设置口令保护和相应的ACL,限定可远程登录的主机IP地址范围,并使用支持加密的登陆方式,如SSL等。2 关闭服务 关闭设备上不需要的服务:Small services (echo, discard, chargen, etc.) Router(config)#no service tcp-small-ser
2、vers Router(config)#no service udp-small-servers FingerRouter(config)#no service fingerRouter(config)#no ip finger HTTP Router(config)#no ip http server SNMP Router(config)#no snmp-server CDPRouter(config)# no cdp run Remote configRouter(config)# no service config Source routingRouter(config)#no ip
3、source-route PadRouter(config)#no service pad ICMPRouter(config)#no ip icmp redirect DNSRouter(config)#no ip name-server 如果需要使用HTTP管理设备,建议采用以下认证方式:确保使用ip http access-class命令来限制只有授权的地址可以访问;确保使用TACACS+或RADIUS对登录进行认证; Router(config)#ip http access-class Router(config)#ip http authentication Router(conf
4、ig)#ip http port 11111 Router(config)#ip http server3 用户名 如果没有使用用户名,增加用户名认证:Router(config)#username myname password mypass 不同的路由器使用不同的方式激活,可能需要使用line vty,然后设置login local,也可能需要启用AAA模式,配置aaa new-model来激活AAA模式。同样将其它的登录console、AUX等,设为需要用户名和口令认证。4 口令 确保所有使用的口令必须为健壮口令,password和enable的口令都需要加密存放,对console li
5、ne、auxiliary line 和virtual terminal lines访问设置密码并加密保护:Enable secret Router(config)#enable secret 0 2manyRt3s Console Line Router(config)#line con 0 Router(config-line)#password Soda-4-jimmY Auxiliary Line Router(config)#line aux 0 Router(config-line)#password Popcorn-4-sara VTY LinesRouter(config)#li
6、ne vty 0 4 Router(config-line)#password Dots-4-georg3 保护口令不以明文显示Router(config)#service password-encryption 确保对console line、auxiliary line 和virtual terminal lines的安全配置:Console LineRouter(config)# line con 0 Router(config-line)# exec-timeout 5 0Router(config-line)# loginRouter(config-line)# transport
7、input telnet Auxiliary LineRouter(config)# line aux 0 Router(config-line)# exec-timeout 0 1Router(config-line)# no execRouter(config-line)# transport input none VTY lines Router(config)# no access-list 92 Router(config)# access-list 92 permit 10.1.1.1 Router(config)# access-list 92 permit 10.1.1.2 R
8、outer(config)# line vty 0 4 Router(config-line)# access-class 92 in Router(config-line)# transport input telnetRouter(config-line)#service tcp-keepalives-in5 访问控制 配置access-list,设置允许登录的IP地址和登录类型,例如允许A.B.C.D地址的ssh登录本IP(1.2.3.4):Router(config)# access-list 110 permit tcp A.B.C.D 1.2.3.4 eq 22 配置防ip spo
9、of的access-list,假设叶子节点网的IP地址段为A.B.C.D mask /24,那么在out的端口上设置:Router(config)# access-list 110 permit ip A.B.C.D 0.0.0.255 anyRouter(config)# access-list 110 deny ip any any在in的端口上设置:Router(config)# access-list 110 deny ip A.B.C.D 0.0.0.255 anyRouter(config)# access-list 110 permit ip any any 配置防CISCO漏洞
10、的拒绝服务攻击:Router(config)# access-list 110 deny 55 any anyRouter(config)# access-list 110 deny 77 any any如果有必要,可以对某些拒绝服务攻击的包进行log。其它类型的拒绝服务,都可以使用相应的访问控制列表进行过滤,但对系统性能可能会有一些影响。其中一些拒绝服务现在操作系统已基本都能防范,不需要特别设置。例如对SYN:Router(Config)# access-list 110 permit tcp any 192.168.0.0 0.0.0.255 establishedLAND:Router(
11、Config)# access-list 110 deny ip host 192.168.0.111 host 192.168.0.111SMURF:Router(Config)# access-list 110 deny ip any host 192.168.0.2556 使用SSH IOS必需为支持IPSEC的版本。 设置SSH的超时间隔和尝试登录次数Router(Config)# ip ssh timeout 90Router(Config)# ip ssh anthentication-retries 2Router(Config)# line vty 0 4Router(Conf
12、ig-line)# access-class 22 inRouter(Config-line)# transport input sshRouter(Config-line)# login localRouter(Config-line)# exit启用SSH服务,生成RSA密钥对。Router(Config)# crypto key generate rsaThe name for the keys will be: router.blushin.orgChoose the size of the key modulus in the range of 360 to 2048 for you
13、r General Purpose keys .Choosing a key modulus greater than 512 may take a few minutes. How many bits in the modulus512: 2048 Generating RSA Keys. OKRouter#7 使用路由协议md5认证 对于网络Router(Config)# router ospf 100Router(Config-router)# network 192.168.100.0 0.0.0.255 area 100启用MD5认证。area area-id authenticat
14、ion 启用认证,是明文密码认证。area area-id authentication message-digestRouter(Config-router)# area 100 authentication message-digestRouter(Config)# exitRouter(Config)# interface eth0/1启用MD5密钥Key为routerospfkey。ip ospf authentication-key key 启用认证密钥,但会是明文传输。ip ospf message-digest-key key-id(1-255) md5 keyRouter(Config-if)# ip ospf message-digest-key 1 md5 routerospfkey如果使用了RIP协议,也使用类似的命令进行设置Router(Config)# key chain mykeychainnameRouter(Config-keychain)# key 1Router(Config-leychain-key)# key-string MyFirstKey
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1