搜档网
当前位置:搜档网 › 路由器配置规范

路由器配置规范


路由器配置规范

文档说明
文档目的:规范、统一用户路由器的配置。按照配置规范模板配置,形成良好的配置习惯,配置具有安全性、可管理性和可阅读性强的特点。
文档更新:根据实践经验和Cisco IOS软件的更新,将定期扩充和更新本文档。

字体说明:
(global configuration)表示在configure terminal后进入的配置模式
(interface configuration)表示端口配置模式

keyword 代表需要配置的关键字
parameter 代表配置参数
基本配置
路由器管理
配置路由器名称
(global configuration) hostname hostname-RT
名称应该具有较强可读性和一致性,需要包含的字段至少应该有:路由器型号、路由器功能、路由器位置或用户标识。比如一台Cisco2650XM路由器作为连接Internet使用,名称可以为2650XM-Internet

配置enable secret和telnet需要登陆
(global configuration) enable secret password
service password-encryption
scheduler allocate 在系统load很高的情况下响应管理进程
line con 0
exec-timeout 5 0
line vty 0 4
login
password telnetpass
exec-timeout 5 0
transport input telnet

配置登陆提示信息
(global configuration) banner login motd %
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Welcome to $(hostname)
Location:Location
Any unauthorized login is illegal
Contact:name telephone or email 用户的管理员
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%

配置关闭不必要的服务
(global configuration) no service finger
no service pad
no service udp-small-servers
no service tcp-small-servers
no ip bootp server

no ip http server
no ip finger
no ip source-route
no ip gratuitous-arps
no ip identd
no ip domain-lookup 若路由器需要DNS解析,不配置

配置syslog和时间
(global configuration) logging console critical
logging buffered 200000
logging facility local7
logging trap debugging
logging ip_address syslog服务器IP地址
logging source-interface interface_type interface_number 指定syslog的源地址

logging rate-limit all 100
logging history size 20
service timestamps debug datetime localtime show-timezone msec
service timestamps log datetime localtime show-timezone msec
line con 0
logging synchronous logging信息不会中断配置命令
line vty 0 4
logg

ing synchronous logging信息不会中断配置命令
时间配置建议使用NTP协议,选择一台核心路由器配置为ntp主服务器,其他路由器为NTP客户端。
NTP服务器
(exec mode) calendar set hh:mm:ss mon day year 有硬件时钟
(exec mode) clock set hh:mm:ss mon day year 无硬件时钟
(global configuration) ntp master 3
(global configuration) clock timezone PST +8

NTP客户端
(global configuration) ntp server server_ip

配置SNMP
(global configuration) snmp-server contact contact 联系人名字电话
snmp-server location location 设备安装地点
snmp-server chasis-id serial_number 序列号
snmp-server community readcommunity RO 65
snmp-server community writecommunity RW 65 除非特殊需要,不要配置,65是access-list的number,只允许符合access-list 65的IP地址作为访问SNMP。
Snmp-server host host_ip_address trap 发送snmp trap到NMS网管服务器

配置Core-dump
Core-dump是路由器crash时将内存保存,配置后路由器传送完内存内容后重新启动,中断时间5-15分钟。
(global configuration) ip ftp username username
ip ftp password password
exception protocol ftp
exception dump FTPserver_address
exception core-file hostnamedump

配置AAA 登陆认证和命令记录
(global configuration) aaa new-model
aaa authentication login telnet group tacacs+ line
aaa accounting commands 1 default start-stop group tacacs+
aaa accounting commands 15 default start-stop group tacacs+
tacacs-server host ip_address key key
管理配置汇总
enable secret password
service password-encryption
line con 0
exec-timeout 5 0
logging synchronous
line vty 0 4

login
password password
logging synchronous
exec-timeout 5 0
transport input telnet

no service finger
no service pad

no service udp-small-servers
no service tcp-small-servers
no ip bootp server
no ip http server
no ip finger
no ip identd
no ip source-route
no ip gratuitous-arps
no ip domain-lookup
ip subnet-zero
ip classless
scheduler allocate


logging console critical
logging buffered 200000
logging facility local7
logging trap debugging
logging rate-limit all 100
logging history size 20
service timestamps debug datetime localtime show-timezone msec

service timestamps log datetime localtime show-timezone msec

ntp server

snmp-server community dsr99o RO 65
snmp-server community dsr99w RW 65

banner login %
Welcome to $(hostname).
any unauthorized access is illegal!
Location:
Contact:%




interface
no ip redirects
no ip proxy-arp
no ip unreachables
no ip directed-broadcast
no ip mask-reply











端口配置
配置IP地址和说明
(in

terface configuration) ip address address netmask
description 功能说明 连接对端设备名 连接对端端口
比如连接XX网点路由器(路由器名为2610XXWAN)的端口,对端端口为S0/0,则说明为 To-Xxwangdian-2610XXWAN-S0/0。
no cdp enable 连接外部的路由器端口关闭CDP

配置端口安全性
(interface configuration) no ip redirects
no ip proxy-arp
no ip unreachables
no ip directed-broadcast
no ip mask-reply


路由配置
配置端口参加路由协议
RIP,IGRP,EIGRP
(Router configuration)network ip_network_of_interface mask wild_ip_mask_of_interface
example interface ip address is 10.1.1.20/28
network 10.1.1.16 mask 0.0.0.15
OSPF
(Router configuration)network ip_network_of_interface wild_ip_mask_of_interface area area_id

配置静态路由
指向下一跳的IP地址,Multi-media的端口以此种方式配置,以太网端口不要配置指向端口的静态路由,需要有明确的下一跳地址。
(global configuration)ip route ip_network network_mask next-hop_address name 功能描述、配置人和配置时间

指向端口,point-to-point的端口以此种方式配置,采用获得IP地址方式端口配置。
(global configuration)ip route ip_network network_mask interface interface_type interface_number name 功能描述、配置人和配置时间
如果路由器是新安装的,配置人和配置时间可以略去。维护中添加的路由要把name 功能描述、配置人和配置时间填写完整。配置人应该是用户的名字或ECCOM公司。


配置路由分发
分发需要明确分发的metric,特别是分发静态路由到EIGRP
(Router configuration)redistribute Router_process metric metric-parameter

双向分发配置,避免分发的泄漏,采用route-map 方式。例子为EIGRP 100到OSPF 1的分发。
(global configuration) Route-map EIGRP100toOSPF1 deny 10
match tag 1
Route-map EIGRP100toOSPF1 permit 20
Set tag 100
Route-map OSPF1toEIGRP100 deny 10
match tag 100
Route-map OSPF1toEIGRP100 permit 20
Set tag 1
Router eigrp 100
Redistribute ospf 1 subnet route-map OSPF1toEIGRP100 metric metric-parameter
Router ospf 1
Redistribute EIGRP 100 route-map EIGRP100toOSPF1 metric metric-parameter

相关主题