常用全局指令介绍
show version指令可以查看路由器的当前软硬件版本号、连续运行时间、所检测到的模块信息等,非常有用
Router#show ver
BDCOM(tm) 2621 Software, Version 1.3.3F (FASTSWITCH)
Copyright by Shanghai Baud Data Communication CO. LTD.
Compiled: 2008-04-03 18:59:02 by system, Image text-base: 0x6004
ROM: System Bootstrap, Version 0.4.3,Serial num:RA014677
System p_w_picpath file is "Router.bin"
(PowerPC) processor with 65536K bytes of memory, 8192K bytes of flash
Router uptime is 0:00:33:07, The current time: 2002-01-01 00:33:07
Slot 0: SCC Slot
Port 0: 10/100Mbps full-duplex Ethernet
Port 1: 10/100Mbps full-duplex Ethernet
Port 2: 2M full-duplex Serial
Port 3: 2M full-duplex Serial
BDCOM(tm) 2621 Software, Version 1.3.3F (FASTSWITCH)
Copyright by Shanghai Baud Data Communication CO. LTD.
Compiled: 2008-04-03 18:59:02 by system, Image text-base: 0x6004
ROM: System Bootstrap, Version 0.4.3,Serial num:RA014677
System p_w_picpath file is "Router.bin"
(PowerPC) processor with 65536K bytes of memory, 8192K bytes of flash
Router uptime is 0:00:33:07, The current time: 2002-01-01 00:33:07
Slot 0: SCC Slot
Port 0: 10/100Mbps full-duplex Ethernet
Port 1: 10/100Mbps full-duplex Ethernet
Port 2: 2M full-duplex Serial
Port 3: 2M full-duplex Serial
show cpu指令可以看到路由器当前的CPU占用率信息。使用时,建议大家多show几次,看平均值;而且该过程也能显示出CPU占用率的波动情况
Router#show cpu
CPU Usage : 0.7% user, 99.3% idle
Router#show cpu
CPU Usage : 0.7% user, 99.3% idle
Router#show cpu
CPU Usage : 0.8% user, 99.2% idle
Router#show cpu
CPU Usage : 0.7% user, 99.3% idle
CPU Usage : 0.7% user, 99.3% idle
Router#show cpu
CPU Usage : 0.7% user, 99.3% idle
Router#show cpu
CPU Usage : 0.8% user, 99.2% idle
Router#show cpu
CPU Usage : 0.7% user, 99.3% idle
注意:如果是博达交换机或者宽带路由器,显示cpu占用率的指令是show task。
show ip interface brief可以显示出路由器当前所有接口的IP地址和状态,是最常用的指令之一
Router#show ip inter br
Interface IP-Address Method Protocol-Status
Async0/0 unassigned manual down
Serial0/2 unassigned manual down
Serial0/3 unassigned manual down
FastEthernet0/0 10.1.0.254 manual up
FastEthernet0/1 unassigned manual down
Virtual-template0 9.9.9.9 manual down
Interface IP-Address Method Protocol-Status
Async0/0 unassigned manual down
Serial0/2 unassigned manual down
Serial0/3 unassigned manual down
FastEthernet0/0 10.1.0.254 manual up
FastEthernet0/1 unassigned manual down
Virtual-template0 9.9.9.9 manual down
show ip route查看路由表,不用说,这个是设备作为路由器最基本的功能,其中包含了路由的类型、目的网段、下一跳网关,优先权等信息
Router#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - BEIGRP, DEX - external BEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - BEIGRP, DEX - external BEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
C 10.1.0.0/24 is directly connected, FastEthernet0/0
Router#show run
show run显示当前正在运行的配置文件,据不完全统计,这是路由器上被使用最多的指令之一。
其功能无需多说。需要关注的是:running-config和startup-config之间的关系:
1、路由器出厂时,Flash中没有startup-config,路由器启动就无法加载,但同样会根据当前接口和模块的配备自动生成一个running-config,这个文件只存放与内存中,一旦掉电就丢失了。
这也是为什么路由器刚刚出厂时,show run输出内容不为空的原因。
注:此时的show run内容非常简单,不足以让路由器能够正常工作或者通信。
2、所有(config#模式中)对路由器指令的增加的指令,都直接作用于running-config。因为running-config是存放于内存中,所以对路由器的指令修改将会即时生效。当执行Write保存指令时,路由器将会吧running-config的内容写入到startup-config中。
3、当系统关机时,running-config丢失,但startup-config可悲保存下来。下次系统重启时,可以正常加载、运行。
转载于:https://blog.51cto.com/mmfrancis/256087