路由器配置命令.doc_第1页
路由器配置命令.doc_第2页
路由器配置命令.doc_第3页
路由器配置命令.doc_第4页
路由器配置命令.doc_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

路由器配置命令类别命令格式命令含义基本配置R enable从用户模式进入特权模式R# disable从特权模式退到用户模式R# logout (或exit)退出Cisco设备R# show history查看先前输入的命令(默认10个)R# terminal history size #_of_commands改变历史缓存的大小(最大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)禁用debugR(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中的配置文件保存到NVRAMR# 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 0x21422600、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-zeroIOS12.0前默认禁用0子网,此命令为启用R(config-if)# ip directed-broadcastIOS12.0后默认禁用定向广播,此命令为启用R# show interfaces type slot_#/ port_#验证接口配置R# show ip interfaces type slot_#/ port_# brief验证接口IP配置CDPR(config)# no cdp run启用/禁用CDPR(config-if)# no cdp enable基于接口启用/禁用CDPR# show cdp查看CDP状态R# show cdp interface查看基于接口的CDP配置R# show cdp neighbors detail查看与用户Cisco设备相连的CDP邻居的摘要/详细清单R# show cdp entry neighbors_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 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_#指定子接口中继类型和相关的VLANR(config)# router name_of_the_IP_routing_protocol进入路由选择协议的配置模式R# show ip route查看IP路由表RIPR(config)# router rip配置IP RIPR(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更新时使用哪个版本的RIPR# show ip protocols查看在路由器上已配置并运行的所有IP路由选择协议R# show ip route name_of_the_IP_routing_protocol查看路由选择表R# debug ip rip帮助进行故障排除IGRPR(config)# router igrp AS_#配置IP IGRPR(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使路由器只使用最佳路径但又在路由选择表中放入替代路径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提供有关包含在路由更新中路由的详细信息EIGRPR(config)# router eigrp AS_#配置EIGRPR(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 topology查看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查看邻居的信息OSPFR(config)# router ospf process_ID配置OSPFR(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允许创建完全存根区域R(config-router)# area area_id nssa允许创建次存根区域R(config-router)# area area_id virtual-link router_id连接不连续区域为骨干区域0R(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的路由器IDR# 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分组的内容ACLR(config)# access-list 1-99|1300-1999 permit|deny source_IP_address wildcard_mask log创建标准编号IP ACLR(config-if)# ip access-group ACL_# in|out在指定接口上启动ACLR(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 ACLR(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启动命名ACLR# 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为重叠地址转换配置NATR(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 *清除所有NAT表项R# clear ip nat translation inside|outside global_IP_address|local_IP_address清除转换表中的指定动态条目R# clear ip nat translation protocol inside global_IP_address global_port local_IP_address local_port清除转换表中的指定动态条目R# debug ip nat提供IOS对每个已转换分组所做的转换 DHCPR(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指定租约的期限(默认一天)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|*清除分配给客户的指定/所有地址R# debug ip dhcp server events|packet|linkage查看DHCP服务器相关信息HDLCR(config-if)# encapsulation hdlc封装同步串行接口为HDLC(默认)PPPR(config-if)# encapsulation ppp在WAN接口上使用PPPR(config-if)# ppp pap sent-username your_hostname password password指定PAP用于认证并且提供在服务端用于执行认证的用户名和口令(此为客户端配置)R(config)# hostname your_routers_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认证情况FRR(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清除逆向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_#配置子接口的帧中继ISDNR(config-if)# isdn switch-type ISDN_switch_type在全局或接口配置模式下配置交换机类型R(config-if)# isdn spid1 spid_#_for_1st_BRI local_dial_#为第一个B信道配置SPIDR(config-if)# isdn spid2 spid_#_for_2st_BRI local_dial_#为第二个B信道配置SPIDR(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_routers_IP_address|router_interface administrative_distance配置静态路由。以下7个命令配置传统DDRR(config)# dialer-list list_# protocol protocol_name permit|deny access-list ACL_#定义敏感流量R(config-if)# dialer-group dialer_list_#激活拨号列表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查看激活的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_#激活拨号列表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统计信息IS-ISR(config)# router isis启动IS-ISR(config-router)# net areaID.systemID.SEL配置NETR(config-router)# is-type level_of_router配置路由器的层次R(config-if)# ip router isis在接口上启动IS-ISR(config-if)# isis priority value level-1|level-2手动配置第一层或第二层路由器的优先级R(config-if)# clns router isis为无连接网络服务启动IS-ISR# show ip route isis查看通过IS-IS学习到的路由R# show isis database detail level_of_router查看IS-IS链路状态数据库中的所有(某层)LSP信息R# show clns protocol显示IS-IS详细配置信息R# show clns interface显示配置为IS-IS接口的相关信息R# show clns is-neighbors查看路由器的邻居R# show isis spf-log查看SPF计算情况R# debug isis adj-packets查看路由器发送和接收Hello PDU的情况R# debug isis update-packets提供路由器发送和接收的所有LSP详细内容及SNP信息R# debug isis spf-events查看写入路由表的IS-IS路由R# debug isis spf-triggers查看触发SPF计算的原因R# debug isis spf-statistics查看执行SPF计算所用的时间BGPR(config)# router bgp AS_#启动BGPR(config-router)# neighbor IP_address_remote_device remote-as AS_#_remote_device指定远端路由器作为对等体R(config-router)# no synchronization关闭BGP与IGP同步(默认启用)R(config-router)# neighbor IP_address_remote_device update-source loopback #使用环回接口作为对等体R(config-router)# neighbor IP_address_remote_device ebgp-multihop ttl配置eBGP多跳(允许BGP邻居可以不在直连网络上)R(config-router)# neighbor IP_address_remote_device route-reflector-client配置邻居为路由反射器客户R(config-router)# network network_address mask subnet_mask向对等体通告路由(手动向BGP注入路由)R(config-router)# redistribute protocol process_ID将路由重新分配到BGPR(config-router)# redistribute connected将直连接口地址重新分配到BGPR(config-router)# bgp cluster-id cluster_ID分配簇IDR(config-router)# bgp confederation identifier confederation_ID配置联邦IDR(config-router)# bgp confederation peers AS_#配置联邦的对等自治系统成员R(config

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论