router命令
一、路由器用户界面概述
    Router con0 is now available.
    Press RETURN to get started.
    User Access Verification
    Password:
    Router> enable
    Password:
    Router#
    Router# disable
    Router>
    Router>exit
    To log out of the router, type exit
    二、用户模式命令列表
    /*进入方式*/
    Password:
    Router> ?
    命令              描述
    Access-enable     创建一条临时的访问控制列表条目
    Atmsig            执行有关ATM信令的命令
    Cd                改变当前的设备
    Clear             将变量清空
    Connect           打开一个终端连接
    Dir               列出给定设备上的文件
    Disable           退出特模式
    Disconnect        关闭一个已经存在的网络连接
    Enable            进入特许模式
    Exit              退出EXEC
    Help              获得关于IOS交互式帮助系统的描述
    Lat               打开一个LAT连接
    Lock              锁定终端
    Login             用特定的用户登录
    Logout            退出EXEC
    Mrinfo            向组播路由器询问邻居和版本的信息
    Mstat             显示多次组播路由跟踪的统计信息
    Mtrace            跟踪从目的到源的反向组播路径
    Name-connection   为已经存在的连接命名
    Pad               打开一个X.29 PAD连接
    Ping              发送echo消息
    Ppp               启动IETF点到协议(ppp)
    Pwd               显示当前的设备
    Resume            继续一个活动的连接
    Rlogin            打开一个rlogin连接
    Show              显示运行系统的信息
    Slip              启动串行线路IP协议(SLIP)
    Systat            显示有关终端连接的信息
    telnet            打开一个telnet连接
    Terminal          设置终端连接的参数
    Tn3270            打开一个TN3270连接
    Traceroute        启动到目的地的路由跟踪
    Tunnel            打开一个隧道(tunnel)连接
    Where             显示所有地活动连接
    X3                在PAD上设置X.3参数
    Xremote           进入Xremote模式
三、特许模式命令列表
    /*进入方式
*/
    Password:
    Router> enable
    Password:
    Router# ?
   
    命令               描述
    Access-enable      创建一条临时的访问控制列表条目
    Access-template    创建一条临时的访问控制列表条目
    Appn               向APPN子系统发送一条命令
    Atmsig             执行有关ATM信令的命令
    Bfe                设置手工紧急模式
    Calendar           管理硬件的日志
    Cd                 改变妆当前的设备
    Clear              将变量清空
    Clock              管理系统的时钟
    Cmt                启动和停止FDDI连接管理
    Configure          进入全局配置模式
    Connect            打开一个终端连接
    Copy               拷贝配置或映像数据
    Debug              使用调试功能(与unduebug相反)
    Delete             删除一个文件
    Dir                列出给定设备上的文件
    Disable            退出特模式
    Disconnect         关闭一个已经存在的网络连接
    Enable             进入特许模式
    Erase              擦除闪存(Flash)或存放配置文件的存储器中的内容
    Exit               退出EXEC
    Format             格式化某个设备
    Help               获得关于IOS交互式帮助系统的描述
    Lat                打开一个LAT连接
    Lock               锁定终端
    Login              用特定的用户登录
    Logout             退出EXEC
    Mbranch            沿树枝向下跟踪组播路由
    Mrbranch           沿树枝向上跟踪反向的组播路由
    Mrinfo             向组播路由器询问邻居和版本的信息
    Mstat              显示多次组播路由跟踪的统计信息
    Mtrace             跟踪从目的到源的反向组播路径
    Name-connection    为已经存在的连接命名
    Nica               启动/停止NCIA服务器
    Pad                打开一个X.29 PAD连接
    Ping               发送echo消息
    Ppp                启动IETF点到协议(ppp)
    Pwd                显示当前的设备
    Reload             关机并执行冷启动
    Resume             继续一个活动的连接
    Rlogin             打开一个rlogin连接
    Rsh                执行一个远程命令
    Sdlc               发送SDLC测试帧
    Send               在tty连接上发送消息
    Setup              启动setup命令配置工具
    Show               显示运行系统的信息
    Slip               启动串行线路IP协议(SLIP)
    Squeeze            挤压某个设备
    Start-chat         在一个连接上启动一个聊天脚本
    Systat             显示有关终端连接的信息
    Tarp               目标有关终端连接的信息
    telnet             打开一个telnet连接
    Terminal           设置终端连接的参数
    Tn3270             打开一个TN3270连接
    Traceroute         启动到目的地的路由跟踪
    Tunnel             打开一个隧道(tunnel)连接
    Undebug            停止调试功能(与duebug相反)
    Verify             检查某个Flash文件的校验和
    Where              显示所有地活动连接
    Write              将当前运行的配置文件写入存储器、网络或终端
    X3                 在PAD上设置X.3参数
    Xremote            进入Xremote模式
四、使用路由器的帮助功能
    Router# clok
    Translating ”clok”
    % Unknown command or computer name,or unable to find computer address
    Router# cl?
    Clear  clock
    Router# clock
    % Incomplete command.
    Router# clock ?
    Set    Set the time and date
    Router# clock set
    % Incomplete command.
    Router# clock set ?
    Current time (hh : mm : ss)
    Router# clock set 19:56:00
    % Incomplete command.
    Router# clock set 19:56:00 ?
      Day of the month
    Month   Month of the year
    Router# clock set 19:56:00 04 8
    ^
    % Invalid input detected at the “^” marker
    Router# clock set 19:56:00 04 August
    % Incomplete command.
    Router# clock set 19:56:00 04 August ?
       Year
    Router# clock set 19:56:00 04 August 2002 ?
   
     Router# clock set 19:56:00 04 August 2002
    五、使用IOS的编辑命令
    命令                      描述
    Ctrl + A                  移至命令行开头
    Ctrl + E                  移至命令行末尾
    Ctrl + F                  前移一个字符
    Ctrl + B                  后移一个字符
    Esc + B                   前移一个单词
    Esc + F                   后移一个单词
六、使用IOS的命令历史功能
    命令
                      描述
    Ctrl + P或 ↑(向上箭头) 重用前一条命令
    Ctrl + N或 ↓(向下箭头) 重用下一条命令
    Show history              显示命令缓冲区的内容
    Terminal history [size number-of line]
                              设置命令缓冲区的大小
    No terminal editing       禁用高级编辑特性
    Terminal editing          重新启用高级编辑特性
    Tab                       完成命令行
    Terminal history size [0-256]
                              设置历史缓冲区中的大小(默认10条)
    History size [0-256]      设置历史缓冲区中的大小(默认10条)
    七、使用路由器状态命令检查路由器的状态
    命令                      描述
    Show version              显示系统的硬件配置、软件版本、配置文件的名称和来
源、启动映象的信息以及最近一次系统重动的原因
    Show flash                显示闪存设备的信息
    Show processes            显示有关活动进程的信息
    Show processes cpu        显示CPU活动进程的信息
    Show memory               显示有关路由器内存的统计信息,包括内存空闲的统计
信息
    Show stacks               监视进程和终端例程所使用的堆栈
    Show buffers              显示有关路由器缓冲空间统计信息
    Show startup-config Cisco IOS 13.0以后版本,用于显示备份的配置文件
    Show config Cisco IOS 13.0以前版本,用于显示备份的配置文件
    Show running-config Cisco IOS 13.0以后版本,用于显示活动的配置文件
    Write terminal Cisco IOS 13.0以前版本,用于显示活动的配置文件
    Show protocols            显示已经配置的协议。
                              该命令能显示所配置的任何一种3层(网络层)协议的状

    Show interface            显示路由器上进行了配置的所有端口的统计信息
    Show arp                  显示路由器的IP到MAC(接口的)地址映射
    八、Showing CDP Neighbor所获得的各项信息
    Router# show cdp neighbors
    显示的信息:
    Devie identifiers(设备标识) 路由器所配置的用户名、域名
    Address list(地址列表) 每个协议对一个地址,至少用于一个SNMP的地址
    Port identifier(端口标识) 如:E0、S0
    Capabilities list(功能列表) 例如:是否既是源路由器网桥又是路由器的信息
    Version(版本) 与show version获得的信息相同
    Platform(Platform) 设备的硬件平台,如:CISCO 7000
    九、CDP的一个配置实例
Router (config-if)# cdp enable
Router (config-if)# cdp disable
Router# show cdp interface
    十、Showing CDP Neighbors
Router# show cdp neighbors
Router# show cdp neighbors detail
Router# show cdp interface
Router# show interface
十一、基本网络测试
    1、用Telnet命令测试应用层
Router> telnet

Router> connect

Router>

Router>
/*Resume a Session(enter session number orname)*/
Router110> show session
1*    Router110
2     Router
Router110> 2
Router>
Router> show session
1     Router110
2*    Router
Router>1
Router110>
/*End a session*/
Router110> exit

Router110> logout

Ctrl + shift + 6 + x
    2、用ping命令测试网络层
Router> ping
Router> ping
Router# ping
Router# ping
Router> ping ipx
Router# ping ipx
Router# ping
(注:不加参数可用于ping的扩展)
    3、用trace命令测试网络层
Router> Trace
Router> Trace ip
Router# Trace
Router# Trace ip
    4、用show ip route命令测试网络层
Router> show ip route
Router# show ip route
    5、使用show interfaces serial命令测试物理层和数据链路层
Router> show interface serial
Router# show interface serial
    6、Show interfaces和clear counters
Router> show interface
Router# show interface
Router# clear counters
    7、用debug命令查实时的网络通信
Router# terminal monitor
(注:在Telnet端打开终端监控,使debug输出到Telnet会话窗)
Router# dubug broadcast
Router# dubug
Router# undebug all
Router# no debug all
8、与路由器启动相关的命令
Router# show startup-config
Router# show config
Router# show running-config
Router# write term
Router# erase startup-config
Router# write erase
Router# reload
Router# setup
    十二、路由器配置
    1、操作IOS11.x版本的配置文件
    命令                     描述
    Configure terminal       从控制台终端手工配置路由器
    Copy tftp running-config 从网络中的TFTP服务器上加载配置文件
    Configure network Cisco IOS 13.0以前版本,现在由Copy tftp running-config命
令替换
    Copy startup-config running-config 从NVRAM中加载配置文件(多用于口令恢复)
    Configure memory Cisco IOS 13.0以前版本,现在由Copy startup-config running
-config命令替换
    Show running-config      显示RAM中的当前配置
    Write terminal Cisco IOS 13.0以前版本,现在由show running-config 命令替换
    Copy running-config tftp 将RAM中的当前配置保存到网络中的TFTP服务器上
    Write network Cisco IOS 13.0以前版本,现在由Copy running-config tftp命令替

    Copy running-config startup-config 将RAM中的当前配置保存到NVRAM中
    Write memory Cisco IOS 13.0以前版本,现在由Copy running-config startup-
config命令替换
    Show startup-config      显示NVRAM中保存的配置的内容
    Show config Cisco IOS 13.0以前版本,现在由show startup-config 命令替换
    Erase startup-config     清空NVRAM的内容
    Write erase Cisco IOS 13.0以前版本,现在由erase startup-config 命令替换
    2、路由器的配置模式
    配置模式                 提示符
    用户EXEC模式             Router>
    特许EXEC模式             Router#
    全局配置模式             Router(config)#
    Interface                Router(config-if)#
    Subinterface             Router(config-subif)#
    Controller               Router(config-controller)#
    Map-list                 Router(config-map-list)#
    Map-class                Router(config-map-class)#
    Line                     Router(config-line)#
    Router                   Router(config-router)#
3、全局配置模式
/*特许EXEC模式下的configure命令
*/
Router con0 is now available.
Press RETURN to get started.
User Access Verification
Password:
Router>
Router> enable
Password:
Router#
Router# configure terminal
Router(config)#
Router(config)#interface Ethernet 0/0
Router(config-if)#
Router(config-if)# exit
Router(config)#
Router(config)# exit
Router#
Router# disable
Router>
Router> exit
Press RETURN to get started.
    或用快速的退出方法:
Router(config-if)# end
(注:end和Ctrl + Z的作用一样)
Router#
Router# exit
Press RETURN to get started.
    4、配置路由协议
Router# configure terminal
Router(config)# router
Router(config-router)#  (command)
Router(config-router)#
    5、配置某个接口*/
Router# configure terminal
Router(config)# interface 

Router(config)# interface 
Router(config-if)# no shutdown
Router(config-if)#
    6、配置特定的接口
Router(config)# interface serial 1/0
Router(config-if)# no shutdown
Router(config-if)# bandwidth 56
Router(config-if)# clock rate 56000
Router(config-if)#
Router(config-if)# int & 0.1 point-to point
Router(config-if)# int & 0.2 point-to point
/*Cisco 4000系列路由器*/
Router(config)# interface Ethernet 1/0
Router(config-if)# media-type 10baset
Router(config-if)#
    7、配置口令的方法
Router(config)# line console 0
Router(config-line)# login
Router(config-line)# password
Router(config)# line vty 0 4
Router(config-line)# login
Router(config-line)# password
Router(config)# enable password
Router(config)# enable secret
/*启动加密服务,为所有的口令加密*/
Router(config)# service password-encryption
Router(config)# no service password-encryption
    8、路由器标识配置
/*路由器名称*/
Router(config)# hostname
Tokyo#
/*登录标题*/
Router(config)# banner motd #
#
Router(config)#
/*接口描述*/
Router(config)# interface Ethernet 0
Router(config-if)# description