路由器配置命令汇总_whuangjuan的空间
路由器配置命令
类别 命令格式 命令含义

基本配置
R> enable 从用户模式进入特权模式
R# disable 从特权模式退到用户模式
R# logout (或exit) 退出Cisco设备
R# show history 查看先前输入的命令(默认10个)
R# terminal history size #_of_commands 改变历史缓存的大小({zd0}256)
R# terminal no editing 禁用编辑特性(移去no参数为启用)
R# configure terminal 进入配置模式(退出为end或CTRL-Z)
R(config)# hostname name 改变路由器的名称
R(config)# banner motd delimiting_character banner_character delimiting_character 设置登录横幅
R(config-line)# exec-timeout minutes_# seconds_#
更改休止超时(默认10分钟)
R# show hosts 查看路由器解析表中的静态和动态DNS条目
R> show version 查看路由器综合信息
R# show line   验证线路的配置
R# show processes 查看设备的各个进程的CPU使用率
R# show users 查看登录到这台设备上的所有用户
R# show sessions 查看当前挂起的已经打开的telnet会话
R# term ip netmask-format bit-count|decimal|hexadecimal 改变子网掩码显示方式(在当前登录会话期间有效,在子线路模式下即可保存)
R(config)# ip host name_of_host [TCP_port_#] IP_address […] 创建主机静态解析表(可指定多达8个IP地址)
R(config)# ip name-server IP_address_of_DNS_server […] 配置通过访问DNS动态解析主机(可指定多达6个DNS服务器)
R(config)# no ip domain-lookup 禁用DNS查询
R> ping destination_IP_address_or_host_name 查看与目的主机的连通性
R> traceroute destination_IP_address_or_host_name 查看与目的主机间的路由器
R# [telnet|connect] name_of_the_destination|destination_IP_address 打开telnet会话
R# resume connection_# 恢复一个特定的会话
R# disconnect connection_# 结束一个已挂起的telnet会话而无须恢复它并随后从中退出
R# clear line line_# 结束某人的会话
R# no debug all (或undebug all) 禁用debug
R(config)# service timestamps debug datetime msec 在debug输出中显示时间戳
R# terminal monitor 从VTY或辅助线路端口登录执行,路由器将在屏幕上显示报告消息
R(config-line)# logging synchronous 在该线路上报告信息后路由器在新提示符后重新显示未打完的命令

文件操作
R# show running-config 查看正在运行(当前)的配置文件
R# show startup-config 查看NVRAM中的配置文件
R# copy running-config|startup-config tftp 将配置备份到TFTP服务器
R# copy tftp startup-config|running-config 从TFTP服务器将配置恢复到路由器
R# copy startup-config running-config 从NVRAM中将配置恢复到RAM中
R# copy running-config startup-config 将RAM中的配置文件保存到NVRAM
R# erase startup-config 删除NVRAM中的配置文件
R# copy flash tftp 备份IOS镜像到TFTP服务器
R# show flash 查看闪存中的文件

启动配置
R# setup 运行系统配置会话
R(config)# boot system flash name_of_IOS_file_in_flash 启动时加载闪存中的指定IOS文件
R(config)# boot system tftp IOS_image_name IP_address_of_server 启动时加载TFTP服务器里的IOS文件
R(config)# boot system rom 启动时加载ROM中的迷你IOS文件(启动与这三个命令的顺序有关)
R(config)# config-register 0x hexadecimal_value 改变寄存器的值
rommon 5> confreg 0x2142 2600、3600系列启动后按CTRL-BREAK进入ROMMON模式,改变寄存器的值
R> o/r 0x2142 其他系列路由器改变寄存器的值的方法

密码设置
R(config)# line console 0 进入控制台接口配置模式
R(config-line)# password console_password 配置控制台口令
R(config)# line vty 0 4 进入虚拟终端线路配置模式(根据路由器及IOS最少5个直到很多)
R(config-line)# login 接上条命令,允许进行Telnet访问
R(config-line)# password telnet_password 接上条命令,配置Telnet口令
R(config)# line aux 0 进入辅助端口配置模式
R(config-line)# password console_password 接上条命令,配置辅助端口口令
R(config)# enable password privileged_password 配置特权EXEC口令(不加密)
R(config)# enable secret privileged_password 配置特权EXEC口令(加密)

接口配置
R(config)# interface type [slot_#/] port_# 进入接口子配置模式
R(config-if)# description interface_description 添加接口描述
R(config-if)# no shutdown 启用该接口
R(config)# interface loopback port_# 创建环回接口
R(config-if)# media-type aui|10baset|100baset|mii 指定该接口连接的介质类型
R(config-if)# speed 10|100|auto 指定该接口速率
R(config-if)# [no] half-duplex 指定该接口双工模式
R(config-if)# clock rate rate_in_bits_per_second 指定该DCE串行接口速率
R> show controller serial [slot_#/] port_# 验证该接口是DCE还是DTE,注意空格
R(config-if)# bandwidth rate_in_Kbps 改变该接口的带宽值
R(config-if)# ip address IP_address subnet_mask 配置该接口IP地址
R(config)# ip subnet-zero IOS12.0前默认禁用0子网,此命令为启用
R(config-if)# ip directed-broadcast IOS12.0后默认禁用定向广播,此命令为启用
R# show interfaces [type [slot_#/] port_#] 验证接口配置
R# show ip interfaces [type [slot_#/] port_#] [brief] 验证接口IP配置
CDP R(config)# [no] cdp run 启用/禁用CDP
R(config-if)# [no] cdp enable 基于接口启用/禁用CDP
R# show cdp 查看CDP状态
R# show cdp interface 查看基于接口的CDP配置
R# show cdp neighbors [detail] 查看与用户Cisco设备相连的CDP邻居的摘要/详细清单
R# show cdp entry neighbor's_name 查看一个指定邻居的详细信息
R# show cdp traffic 查看CDP通信量的统计信息

路由
R(config)# ip route destination_network_# [subnet_mask] IP_address_of_next_hop_neighbor|interface_to_exit [administrative_distance] [permanent] 配置IP

静态路由
R(config)# ip route 0.0.0.0 0.0.0.0 IP_address_of_next_hop_neighbor|interface_to_exit [administrative_distance] [permanent]
配置默认路由
R(config)# ip classless 使有类协议接受非一致性子网掩码或不连续子网
R(config)# interface type [slot_#/] port_#. subinterface_# [point-to-point|multipoint] 创建子接口
R(config-subif)# encapsulation isl|dotlq VLAN_# 指定子接口中继类型和相关的VLAN
R(config)# router name_of_the_IP_routing_protocol 进入路由选择协议的配置模式
R# show ip route 查看IP路由表

RIP
R(config)# router rip 配置IP RIP
R(config-router)# network IP_network_# 指定哪些接口参与路由选择进程
R(config-router)# version 1|2 只接受和发送RIP版本1或2(默认只产生RIPv1更新,而两个版本的更新都接收)
R(config-router)# ip rip send|receive version 1 | version 2 | version 1 2 在特定接口上控制在发送或接收RIP更新时使用哪个版本的RIP
R# show ip protocols 查看在路由器上已配置并运行的所有IP路由选择协议
R# show ip route [name_of_the_IP_routing_protocol] 查看路由选择表
R# debug ip rip 帮助进行故障排除

IGRP
R(config)# router igrp AS_# 配置IP IGRP
R(config-router)# network IP_network_# 通告网络号
R(config-router)# neighbor IP_address_of_neighbor 配置单播更新
R(config-router)# passive-interface type [slot_#/] port_# 允许该接口在IGRP中通告但它不监听或发送IGRP更新
R(config-router)# traffic-share min across-interfaces 使路由器只使用{zj0}路径但又在路由选择表中放入替代路径
R(config-router)# timers basic update_# invalid_# holddown_# flush_# [sleeptime_#] 调整定时器(默认时,update=90,invalid=270,holddown=280,flush=630)
R(config-router)# no metric holddown 关闭压制定时器(默认)
R(config-router)# distance administrative_distance_# 调整管理距离(取值范围是1-255,默认为100)
R(config-router)# default-metric bandwidth_# delay_# reliability_# load_# MTU_# 调整度量值
R(config-router)# metric weights tos_# K1_# K2_# K3_# K4_# K5_# 调整度量权重值(默认时,K1(带宽)=K3(可靠性)=1,K2(延迟)=K4(负载)=K5(MTU)=0)
R(config-router)# variance multiplier_# 启用IGRP非同等成本路径(变化因子值是1-128,默认为1)
R(config-router)# traffic-share balanced 配置负载均衡
R(config-router)# maximum-paths paths_# 配置负载均衡的路径条数(取值范围是1-6)
R# debug ip igrp events 提供路由器和邻居间发生的每一步操作信息
R# debug ip igrp transactions 提供有关包含在路由更新中路由的详细信息

EIGRP
R(config)# router eigrp AS_# 配置EIGRP
R(config-router)# network IP_network_# 通告网络号
R(config-if)# ip bandwidth-percent eigrp AS_# percent_# 设置pacing(调速)占给定接口带宽的百分数(默认为50%)
R(config-router)# distance administrative_distance_# 调整管理距离(取值范围是1-255,默认对于内部路由是90而外部是170)
R(config-router)# default-metric bandwidth_# delay_# reliability_# load_# MTU_# 调整度量值
R(config-router)# metric weights tos_# K1_# K2_# K3_# K4_# K5_# 调整度量权重值(默认时,K1(带宽)=K3(可靠性)=1,K2(延迟)=K4(负载)=K5(MTU)=0)
R(config-if)# ip hello-interval eigrp AS_# seconds_# 在给定接口上设置Hello间隔(默认对于低速的NBMA网络是60秒,其他是5秒)
R(config-if)# ip hold-time eigrp AS_# seconds_# 在给定接口上设置Hello保持定时器(默认是3倍的Hello间隔)
R(config-router)# passive-interface type [slot_#/] port_# 允许该接口在EIGRP中通告但它不监听或发送EIGRP更新
R(config-router)# no auto-summary 取消对路由的自动汇总
R(config-if)# ip summary-address eigrp AS_# network_address network_mask 创建不在有类边界上的汇总地址
R(config)# eigrp log-neighbor-changes 记录在某个邻居上发生的变化
R# show ip route eigrp 查看被EIGRP学习到的路由
R# show ip route network_address 查看指定目的地的路由信息
R# show ip eigrp togy 查看EIGRP的拓扑表
R# show ip eigrp interfaces   查看加入到EIGRP路由器所有接口的概述
R# show ip eigrp neighbor [detail] 显示和本路由器已形成邻居关系的所有路由器
R# show ip eigrp traffic 显示每个包类型的发出和接收的数量
R# show ip eigrp events 查看每个EIGRP事件的日志
R# debug ip eigrp 提供路由器和它的邻居之间发生的每一步操作
R# debug eigrp packets 查看在该路由器和它的邻居之间发送的数据包类型
R# debug eigrp neighbors 查看邻居的信息

OSPF
R(config)# router ospf process_ID 配置OSPF
R(config-router)# network IP_address wildcard_mask area area_# 指定接口进入OSPF区域
R(config-if)# ip ospf cost cost_value 给接口指定成本(取值范围是1-65535)
R(config-router)# neighbor IP_address_of_neighbor 手动配置邻居
R(config-router)# neighbor IP_address_of_neighbor priority value 指定邻居的优先级(取值范围是0-255,255为DR,0为不可能成为DR)
R(config-if)# ip ospf network non-broadcast 手工配置非广播网络类型
R(config-router)# area area_id stub 允许创建存根区域
R(config-router)# area area_id stub no-summary 允许创建xx存根区域
R(config-router)# area area_id nssa 允许创建次存根区域
R(config-router)# area area_id virtual-link router_id 连接不连续区域为骨干区域0
R(config-router)# area area_id range network_address network_mask 在区域边界路由器上汇总在给定区域中的路由器使用的IP地址空间到其他的区域
R(config-router)# summary-address network_address network_mask 在自治系统边界路由器上汇总外部路由
R# show ip ospf 概述所有OSPF相关的信息
R# show ip ospf process-id 与上相同,而不仅仅是指定的进程
R# show ip ospf border-routers 显示在此自治系统中所有ABR和ASBR的路由器ID
R# show ip ospf database 显示链路状态数据库
R# show ip ospf interface 显示接口的OSPF参数和其他的指定到此接口上的OSPF信息
R# show ip ospf neighbor [detail] 显示每个OSPF邻居和邻接状态
R# debug ip ospf adj 报告路由器建立到其他路由器的邻接关系进程
R# debug ip ospf events 报告路由器上的OSPF事件
R# debug ip ospf packet 报告OSPF LSA分组的内容

ACL
R(config)# access-list 1-99|1300-1999 permit|deny source_IP_address [wildcard_mask] [log] 创建标准编号IP ACL
R(config-if)# ip access-group ACL_# in|out 在指定接口上启动ACL
R(config-line)# access-class standard_ACL_# in|out 在指定若干线路上启动ACL以限制对路由器的Telnet访问
R(config)# access-list 100-199|2000-2699 permit|deny IP_protocol source_address source_wildcard_mask [protocol_information] destination_address destination_wildcard_mask [protocol_information] [log] 创建扩展编号IP ACL
R(config)# ip access-list standard ACL_name 创建标准命名ACL(从IOS11.2开始支持)
R(config-std-acl)# permit|deny source_IP_address [wildcard_mask] 输入标准ACL命令
R(config)# ip access-list extended ACL_name 创建扩展命名ACL(从IOS11.2开始支持)
R(config-ext-acl)# permit|deny IP_protocol source_IP_address wildcard_mask [protocol_information] destination_IP_address wildcard_mask [protocol_information] [log] 输入扩展ACL命令
R(config-if)# ip access_group ACL_name in|out 启动命名ACL
R# show ip interfaces   验证访问列表
R# show access-lists [ACL_#_or_name] 显示ACL中的语句
R# show ip access-list [ACL_#_or_name] 显示IP ACL中的语句
R# clear access-list counters [ACL_#_or_name] 对指定ACL中的匹配计数器清零

NAT PAT 配置负载分发
R(config)# ip nat inside source static inside_local_source_IP_address inside_global_source_IP_address 定义NAT静态转换
R(config)# ip nat outside source static outside_global_destination_IP_address outside_local_destination_IP_address 定义NAT静态转换
R(config-if)# ip nat inside|outside 指定路由器上哪些接口在内部,哪些在外部
R(config)# ip nat outside source list standard_IP_ACL_# pool NAT_pool_name 为重叠地址转换配置NAT
R(config)# ip nat inside source list standard_IP_ACL_# pool NAT_pool_name 定义动态NAT,指定转换哪些内部设备的源地址
R(config)# ip nat pool NAT_pool_name beginning_inside_global_IP_address ending_inside_global_IP_address netmask subnet_mask_of_addresses|prefix-length length 创建源内部全局IP地址池
R(config)# ip nat inside source list standard_IP_ACL_# pool NAT_pool_name overload 定义PAT,指定哪台内部设备会转换其源地址
R(config)# ip nat pool pool_name beginning_inside_local_IP_address ending_inside_local_IP_address prefix-length subnet_mask_bits type rotary 指定提供服务的设备上配置的内部IP地址
R(config)# ip nat inside destination list standard_ACL_# pool pool_name 指定外部设备用来访问内部资源的全局IP地址
R# show ip nat translations [verbose] 查看路由器上的(详细)地址转换信息
R# show ip nat statistics 查看路由器上的地址转换的统计信息
R# clear ip nat translation * xx所有NAT表项
R# clear ip nat translation inside|outside global_IP_address|local_IP_address xx转换表中的指定动态条目
R# clear ip nat translation protocol inside global_IP_address global_port local_IP_address local_port xx转换表中的指定动态条目
R# debug ip nat 提供IOS对每个已转换分组所做的转换

DHCP
R(config)# [no] service dhcp 启用/禁用DHCP(默认启用)
R(config)# ip dhcp pool pool_name 创建地址池
R(config-dhcp)# network network_number [subnet_mask|/prefix_length] 指定分配给客户的IP地址范围
R(config-dhcp)# domain-name domain_name 向客户分配域名
R(config-dhcp)# dns-server IP_address […] 指定最多8台DNS服务器分配给客户
R(config-dhcp)# netbios-name-server IP_address […] 指定最多8台WINS服务器分配给客户
R(config-dhcp)# netbios-node-type node_type 向微软客户分配节点类型
R(config-dhcp)# default-router IP_address […] 指定最多8条默认路由给客户用于该地址范围
R(config-dhcp)# lease days [hours] [minutes] |infinite 指定租约的期限(默认{yt})
R(config)# ip dhcp ping timeout milliseconds 指定测试服务器地址池中的可用地址是否正在使用时服务器应等待时间
R(config)# ip dhcp excluded-address beginning_IP_address [ending_IP_address] 排除一些地址
R(config-if)# ip address dhcp 在路由器上建立DHCP客户
R# show ip dhcp binding [client_address] 查看分配给客户的地址
R# clear ip dhcp binding client_address|* xx分配给客户的指定/所有地址
R# debug ip dhcp server events|packet|linkage 查看DHCP服务器相关信息
HDLC R(config-if)# encapsulation hdlc 封装同步串行接口为HDLC(默认)
PPP R(config-if)# encapsulation ppp 在WAN接口上使用PPP
R(config-if)# ppp pap sent-username your_hostname password password 指定PAP用于认证并且提供在服务端用于执行认证的用户名和口令(此为客户端配置)
R(config)# hostname your_router's_hostname 为路由器指定惟一主机名(以下三个为服务端配置)
R(config)# username remote_hostname password matching_password 指定认证路由器时所使用的远端主机名称和口令
R(config-if)# ppp authentication pap 指定PAP认证
R(config-if)# ppp authentication chap|pap|chap pap|pap chap 批定PPP认证类型
R# debug ppp negotiation 查看LCP协商时的信息
R# debug ppp authentication 查看PPP认证情况

FR
R(config-if)# encapsulation frame-relay [cisco|ietf] 指定封装类型为帧中继(默认cisco)
R(config-if)# frame-relay lmi-type ansi|cisco|q933a 给该串行接口指定LMI类型
R# show frame-relay lmi 查看详细的LMI统计信息
R# debug frame-relay lmi 报告路由器正在发送与接收的实际LMI信息
R(config-if)# frame-relay map protocol_name destination_address local_dlci_# [broadcast] [ietf|cisco] 将远端第3层地址手动映射到本地DLCI号
R(config-if)# [no] frame-relay inverse-arp [protocol_name] [DLCI_#] 启用/禁用逆向ARP(默认启用)
R(config-if) clear frame-relay-inarp xx逆向ARP解析表
R# show frame-relay traffic 查看逆向ARP统计
R# show frame-relay pvc [DLCI_#] 查看终止于路由器的所有(指定)帧中继PVC及其统计信息
R# show frame-relay map 查看将第3层地址映射成本地DLCI号的虚电路解析表
R(config)# interface type [slot_#/] port_#. subinterface_# [point-to-point|multipoint] 创建子接口
R(config-subif)# frame-relay interface-dlci local_DLCI_# 配置子接口的帧中继

ISDN
R(config[-if])# isdn switch-type ISDN_switch_type 在全局或接口配置模式下配置类型
R(config-if)# isdn spid1 spid_#__for_1st_BRI local_dial_# 为{dy}个B信道配置SPID
R(config-if)# isdn spid2 spid_#__for_2st_BRI local_dial_# 为第二个B信道配置SPID
R(config)# controller t1|e1 [slot_#/] port_# 以下6个命令为控制卡配置
R(config-controller)# framing esf|sf|crc4|nocrc4 在T1或E1上使用物理成帧
R(config-controller)# linecode ami|b8zs|hdb3 线路编码,定义1与0如何在线路上物理表示
R(config-controller)# clock source line primary|secondary|internal 定义路由器如何获得其时钟以用于同步数字连接
R(config-controller)# pri-group timeslots [1-24|1-31] 指定路由器哪个或哪些时隙用于ISDN连接
R(config-controller)# [no] shutdown 启用/禁用控制器
R# show controllers t1|e1 [slot_#/port_#] 验证控制器卡配置
R(config)# interface serial [slot_#/] port_#:23 设置逻辑串口(T1使用)
R(config)# interface serial [slot_#/] port_#:15 设置逻辑串口(E1使用)
R# show interface bri [slot_#/] port_#[:1|2|1 2] 验证ISDN连接的状态(查看B信道)
R# show isdn status 查看ISDN详细的物理层和数据链路层信息
R# debug isdn q921 报告ISDN数据链路层详细信息
R(config)# ip route IP_network_# subnet_mask remote_router's_IP_address|router_interface [administrative_distance] 配置静态路由。以下7个命令配置传统DDR
R(config)# dialer-list list_# protocol protocol_name permit|deny [access-list ACL_#] 定义敏感流量
R(config-if)# dialer-group dialer_list_# xx拨号列表
R(config-if)# dialer map protocol_name address_of_destination_router [name remote_router_name] [speed 56|64] [broadcast] destination_phone_number 表明利用传统DDR进行电话呼叫
R(config-if)# dialer idle-timeout #_of_seconds 定义空闲超时周期
R(config-if)# dialer fast-idle #_of_seconds 定义快速空闲计时器
R(config-if)# dialer load-threshold load either|inbound|outbound 通过BRI的两条B信道执行负载均衡(分配带宽)
R# show dialer 查看哪个DDR接口进行了电话呼叫及其状态
R# show isdn active 查看xx的ISDN呼叫
R# show isdn history 查看路由器发出的呼叫或以前接收的呼叫
R# debug dialer 显示建立或拆除一个连接的DDR过程
R# debug isdn q931 显示ISDN电话连接建立及挂断的详细信息
R(config)# interface dialer port_# 创建逻辑拨号接口。以下全为配置拨号配置文件。以下8个为拨号接口配置
R(config-if)# encapsulation ppp 指定封装类型
R(config-if)# ppp authentication pap|chap|chap pap|pap chap 指定认证类型
R(config-if)# ip address IP_address subnet_mask 指定接口IP地址
R(config-if)# dialer remote-name name 指定远端路由器的名称
R(config-if)# dialer string phone_# [class map_name] 指定映射类名称
R(config-if)# dialer pool pool_# 指定拨号接口能使用哪组物理接口
R(config-if)# dialer-group dialer_list_# xx拨号列表
R(config-if)# dialer pool-member pool_# [priority priority_#] [min-link #_of_B_channels] [max-link #_of_B_channels] 指定哪些拨号接能使用物理接口
R(config)# map-class dialer map_name 进入映射子配置模式。以下4个为创建映射类
R(config-map)# dialer isdn speed 56 指定ISDN中的B信道的速度(默认64kbps)
R(config-map)# dialer idle-timeout #_of_seconds 定义空闲超时周期
R(config-map)# dialer fast-idle #_of_seconds 定义快速空闲计时器
R# show dialer interface bri|{serial:23|15} [slot_#/]port_# 显示与拨号接口关联的物理接口的进入和离开呼叫的DDR统计信息


郑重声明:资讯 【路由器配置命令汇总_whuangjuan的空间】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——