- 论坛徽章:
- 0
|
第二章 路由器管理
2.1. 创建命令别名
提问 为常用的命令创建简洁的别名
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#alias exec rt show ip route
Router1(config)#alias exec on show ip ospf neighbor
Router1(config)#end
Router1#
注释 show aliases命令可以输出当前配置的别名
2.2. 管理路由器ARP缓存
提问 修改ARP表条目超时时长
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface Ethernet0
Router1(config-if)#arp timeout 600
Router1(config-if)#end
Router1#
注释 缺省情况为4个小时,同时思科没有提供命令能单独的清除某个ARP缓存,只能通过clear arp 命令来清除整个ARP表
2.3. 路由器Buffer调整
提问 手动调整路由器Buffer分配来使其工作的更高效
回答 路由器维护两个Buffer池,public buffers和interface buffers
调整public buffers
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#buffers big initial 100
Router1(config)#buffers big max-free 200
Router1(config)#buffers big min-free 50
Router1(config)#buffers big permanent 50
Router1(config)#end
Router1#
调整interface buffers
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#buffers Ethernet0 initial 200
Router1(config)#buffers Ethernet0 max-free 300
Router1(config)#buffers Ethernet0 min-free 50
Router1(config)#buffers Ethernet0 permanent 50
Router1(config)#end
Router1#
注释 一般不建议修改,如果修改,建议首先使用show buffers命令来查看当前buffer使用情况,调整完以后建议使用show memory来查看内存使用情况
2.4. 自动调整路由器Buffer
提问 希望路由器根据自己的情况自动进行buffer分配调整
回答
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#buffers tune automatic
Router(config)#end
Router#
注释 此命令引自IOS 12.3(14)T,使用show buffers tune命令来查看自动调整情况
2.5. 使用CDP协议
提问 希望获得相连网络设备的信息
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#cdp run
Router1(config)#interface Serial0/0
Router1(config-if)#cdp enable
Router1(config-if)#exit
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no cdp enable
Router1(config-if)#exit
Router1(config)#interface FastEthernet1/0
Router1(config-if)#cdp enable
Router1(config-if)#end
Router1#
注释 CDP(Cisco Discovery Protocol)是思科专有的协议,用于发现相连的思科设备,帮助了解网络拓朴,缺省是启用的,使用show cdp neighbor detail 命令可以查看相连设备的详细信息
2.6. 禁止CDP协议
提问 为了安全期间不想让邻近设备发现自己设备的信息
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#cdp run
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no cdp enable
Router1(config-if)#end
Router1#
注释 为了安全期间可以在边界设备上禁止CDP
2.7. 小服务的开启
提问 开启或者禁用一些类似finger的小服务
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#service tcp-small-servers (no service tcp-small-servers)
Router1(config)#service udp-small-servers (no sercie udp-small-servers)
Router1(config)#end
Router1#
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ip finger (no ip finger)
Router1#
注释 tcp和udp的小服务指开启路由器的echo,discard,daytime和chargen服务,为了安全期间都建议将其关闭
2.8. 启用路由器HTTP访问
提问 通过浏览器来配置和管理路由器
回答
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#access-list 75 permit 172.25.1.1
Router1(config)#access-list 75 deny any
Router1(config)#ip http server
Router1(config)#ip http access-class 75
Router1(config)#end
Router1#
注释 由于IOS 12.1(5)之前存在HTTP访问的高危漏洞,所以如果你的IOS版本小于此版本建议不要开启此服务
2.9. 启用路由器安全HTTPS访问
提问 通过加密的访问HTTP访问路由器
回答
Core#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Core(config)#ip http secure-server
Core(config)#end
Core#
注释 IOS 12.2(14)S之后引入此特性,建议先用no ip http server命令关闭非加密的HTTP访问,然后开启安全的访问,同时可以使用ip http secure-port 8080
命令来更改访问端口 |
|