禁用Finger服务
no service finger
禁用Config服务
no service config
禁用Hootp服务
no iP hootp server
禁用Http Server
no ip http server
禁用IP源路由,防止路由欺骗
no ip source route
禁用Finger服务
禁用小的UDP服务
no service udp-small-s
禁用小的TCP服务
no service tcp-small-s
第三、网络 交换机控制台和虚拟终端的安全部署
在网络交换机虚拟终端(Vty)线路上配置认证,另外还需要对Vty线路使用简单的访问控制列表。
Switch(config-line)#access-class 1 in
Switch(config)#access-list 1 permit 192.168.1.1
Switch(config)#line vty 0 4
第四、禁用 交换机所有没有用的端口
强烈建议网络管理员一定要将没有用的端口ShutDown掉。此方法也能在一定程度上防范恶意用户连接此端口并协商中继模式。
第五、确保交换机STP协议的安全,启用根防护与BPDU防护
STP保护生成树协议,主要是防范其他分公司在新加入一台交换机时,容易配置错误使得新交换机成为根网桥,带来意外的BPDU。因此按以
下需要核心管理员启用根防护与BPDU防护。
A、默认情况下, 交换机端口也禁用BPDU防护。启用它需使用下列命令:
Switch(config)#Spanning-tree Portfast bpduguard default
B、默认情况下交换机端口禁用根防护,要启用它需要使用以下命令:
Switch(config)#spanning-tree guard root
C、如果要在所有端口上启用BPDU防护,可使用下面的命令:
Switch(config)#Spanning-tree Portfast bpduguard enable
第六、网络 交换机用SSH服务代替Telnet服务
网络 交换机的Telnet服务是管理员们连接至交换机的主要通道,但是在Telnet会话中输入的每个字节都将会被明文发送,这可以被类似
Sniffer这样的软件嗅探获取用户名、密码等敏感信息。因此,使用安全性能更高的SSH强加密无疑比使用Telnet更加安全。
test-ssh(config)#crypto key generate rsaThe name for the keys will be:test-ssh.net.ctocio.com
test-ssh(config)#ip ssh time-out 180
test-ssh(config)#ip ssh authentication-retries 5
Switch(config)#hostname test-ssh
test-ssh(config)#ip domain-name net.ctocio.com
test-ssh(config)#username test password 0 test
test-ssh(config)#line vty 0 4
test-ssh(config-line)#login local
通过上述配置将网络 交换机命名为test-ssh,域名为net.ctocio.com,创建了一个命名test密码为test的用户,设置ssh的设为test-ssh.net.ctocio.com,ssh超时时间设为180秒,最大连接次数最好是5次。