在网络工程领域,熟练掌握各种命令是网络工程师必备的技能之一。而在思科设备的管理和维护过程中,show命令是排障、配置和监视网络状态的重要工具。本文将深入介绍35个常用的思科设备show命令,涵盖了配置管理、网络状态查看、邻居和协议状态、安全和监控、高可用性和性能优化、以及VLAN和交换机配置等方面。
无论您是刚刚入门的新手还是经验丰富的老手,本文都将为您提供全面而详细的指南,帮助您更好地理解和应用这些命令,从而更高效地管理和维护您的网络设备。
目录:
[TOC]
1. show running-config
show running-config
命令用于显示当前设备的运行配置。这个命令可以帮助你了解设备的当前状态和配置。
Router# show running-config
返回示例:
Building configuration...
Current configuration : 2033 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$pdQG$blOvq4Ey6KjYPHkYoThzl.
!
no aaa new-model
!
resource policy
!
ip cef
no ip dhcp use vrf connected
ip dhcp excluded-address 192.168.1.1 192.168.1.10
!
ip dhcp pool VLAN1
import all
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 192.168.1.1
!
!
ip domain name yourdomain.com
!
multilink bundle-name authenticated
!
...
2. show startup-configuration
show startup-configuration
命令用于显示设备的启动配置。这个命令可以帮助你了解设备启动时的配置。
Router# show startup-configuration
返回示例:
Using 3098 out of 262136 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$pdQG$blOvq4Ey6KjYPHkYoThzl.
!
no aaa new-model
!
resource policy
!
ip cef
no ip dhcp use vrf connected
ip dhcp excluded-address 192.168.1.1 192.168.1.10
!
ip dhcp pool VLAN1
import all
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 192.168.1.1
!
!
ip domain name yourdomain.com
!
multilink bundle-name authenticated
!
...
3. show version
show version
命令用于显示设备的硬件信息、软件版本、配置寄存器信息以及设备启动时间等信息。
Router# show version
返回示例:
Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 15.1(4)M10, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Mon 17-Oct-16 09:46 by prod_rel_team
ROM: System Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1)
Router uptime is 2 weeks, 5 days, 18 hours, 34 minutes
System returned to ROM by power-on
System image file is "flash:c2800nm-advipservicesk9-mz.151-4.M10.bin"
...
4. show ip route
show ip route
命令用于显示设备的IP路由表。这个命令可以帮助你了解设备的路由信息。
Router# show ip route
返回示例:
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 10.1.1.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.1.1.1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, FastEthernet0/0
L 10.1.1.2/32 is directly connected, FastEthernet0/0
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, FastEthernet0/1
L 192.168.1.1/32 is directly connected, FastEthernet0/1
5. show ipv6 route
show ipv6 route
命令用于显示设备的IPv6路由表。这个命令可以帮助你了解设备的IPv6路由信息。
Router# show ipv6 route
返回示例:
IPv6 Routing Table - default - 7 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
B - BGP, R - RIP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
IS - ISIS summary, D - EIGRP, EX - EIGRP external, ND - ND Default
NDp - ND Prefix, DCE - Destination, NDr - Redirect, O - OSPF Intra
OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1
ON2 - OSPF NSSA ext 2
C 2001:DB8:CAFE:1::/64 [0/0]
via Ethernet0/0, directly connected
L 2001:DB8:CAFE:1::1/128 [0/0]
via Ethernet0/0, receive
S ::/0 [1/0]
via 2001:DB8:CAFE:1::2
C 2001:DB8:CAFE:2::/64 [0/0]
via Serial0/0, directly connected
L 2001:DB8:CAFE:2::1/128 [0/0]
via Serial0/0, receive
L FF00::/8 [0/0]
via Null0, receive
6. show interfaces
show interfaces
命令用于显示设备的接口信息。这个命令可以帮助你了解设备的接口状态和配置。
Router# show interfaces
返回示例:
FastEthernet0/0 is up, line protocol is up
Hardware is Gt96k FE, address is c201.4f00.0000 (bia c201.4f00.0000)
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, 100BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
1 packets input, 64 bytes, 0 no buffer
Received 1 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 1011 multicast, 0 pause input
0 input packets with dribble condition detected
589 packets output, 46676 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
7. show ip interface brief
show ip interface brief
命令用于快速查看设备的接口IP信息。这个命令可以帮助你了解设备的接口IP地址和状态。
Router# show ip interface brief
返回示例:
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 10.1.1.1 YES manual up up
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
8. show ipv6 interface brief
show ipv6 interface brief
命令用于快速查看设备的接口IPv6信息。这个命令可以帮助你了解设备的接口IPv6地址和状态。
Router# show ipv6 interface brief
返回示例:
FastEthernet0/0 [up/up]
FE80::C800:EFF:FE74:0
2001:DB8:CAFE:1::1
FastEthernet0/1 [administratively down/down]
unassigned
Serial0/0/0 [up/up]
FE80::C800:EFF:FE74:1
2001:DB8:CAFE:2::1
Serial0/0/1 [administratively down/down]
unassigned
Vlan1 [administratively down/down]
unassigned
9. show cdp neighbors
show cdp neighbors
命令用于显示设备的CDP邻居信息。这个命令可以帮助你了解设备的邻居设备信息。
Router# show cdp neighbors
返回示例:
Device ID Local Intrfce Holdtme Capability Platform Port ID
Router_2 Fas 0/0 159 R S I 2811 Fas 0/0
Switch_1 Fas 0/1 144 S I WS-C3750G Fas 1/0/1
10. show clock
show clock
命令用于显示设备的当前时间。这个命令可以帮助你了解设备的当前时间。
Router# show clock
返回示例:
*14:22:35.123 UTC Mon Mar 1 2021
11. show ntp status
show ntp status
命令用于显示设备的网络时间协议(NTP)状态。这个命令可以帮助你了解设备的时间同步状态。
Router# show ntp status
返回示例:
Clock is synchronized, stratum 3, reference is 10.1.1.1
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**24
reference time is DDF024E3.7C3AC9C7 (14:22:59.485 UTC Mon Mar 1 2021)
clock offset is 0.0016 sec, root delay is 0.01 sec
root dispersion is 0.02 sec, peer dispersion is 0.02 sec
12. show Flash
show Flash
命令用于显示设备的Flash内存信息。这个命令可以帮助你了解设备的Flash内存使用情况。
命令示例:
Router# show Flash
返回示例:
-#- --length-- -----date/time------ path
1 28057960 Mar 1 2021 14:22:35 +00:00 c2800nm-advipservicesk9-mz.151-4.M10.bin
2 2908 Mar 1 2021 14:22:35 +00:00 home.shtml
3 93184 Mar 1 2021 14:22:35 +00:00 home.tar
4 16983 Mar 1 2021 14:22:35 +00:00 attack-drop.sdf
5 3153316 Mar 1 2021 14:22:35 +00:00 ips-sig-S536-req-E3.pkg
6 150528 Mar 1 2021 14:22:35 +00:00 ips-sig-S536-sigpack-E3.pkg
7 14658560 Mar 1 2021 14:22:35 +00:00 securedesktop-ios-3.1.1.45-k9.pkg
8 4159552 Mar 1 2021 14:22:35 +00:00 sslclient-win-1.1.4.176.pkg
62947328 bytes available (48758784 bytes used)
13. show history
show history
命令用于显示设备的命令历史记录。这个命令可以帮助你了解设备的操作历史。
Router# show history
返回示例:
show version
show running-config
show startup-config
show ip interface brief
show ipv6 interface brief
show cdp neighbors
show clock
show ntp status
show flash
14. show logging
show logging
命令用于显示设备的日志信息。这个命令可以帮助你了解设备的运行日志。
Router# show logging
返回示例:
Syslog logging: enabled (0 messages dropped, 2 messages rate-limited, 0 flushes, 0 overruns, xml disabled, filtering disabled)
No Active Message Discriminator.
No Inactive Message Discriminator.
Console logging: level debugging, 509 messages logged, xml disabled,
filtering disabled
Monitor logging: level debugging, 0 messages logged, xml disabled,
filtering disabled
Buffer logging: level debugging, 509 messages logged, xml disabled,
filtering disabled
Logging Exception size (4096 bytes)
Count and timestamp logging messages: disabled
Persistent logging: disabled
No active filter modules.
Trap logging: level informational, 509 message lines logged
Logging to 10.1.1.1 (udp port 514, audit disabled,
link up),
509 message lines logged,
0 message lines rate-limited,
0 message lines dropped-by-MD,
xml disabled, sequence number disabled
filtering disabled
Log Buffer (4096 bytes):
*Mar 1 14:22:35.123: %SYS-5-CONFIG_I: Configured from console by console
*Mar 1 14:22:35.123: %SYS-5-RESTART: System restarted --
Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 15.1(4)M10, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Mon 17-Oct-16 09:46 by prod_rel_team
15. show protocols
show protocols
命令用于显示设备的网络协议信息。这个命令可以帮助你了解设备的网络协议状态。
Router# show protocols
返回示例:
Global values:
Internet Protocol routing is enabled
FastEthernet0/0 is up, line protocol is up
Internet address is 192.168.1.1/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Multicast reserved groups joined: 224.0.0.5 224.0.0.6 224.0.0.9
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is enabled
IP Flow switching is disabled
IP CEF switching is enabled
IP CEF Fast switching turbo vector
IP multicast fast switching is enabled
IP multicast distributed fast switching is disabled
IP route-cache flags are Fast, CEF
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
RTP/IP header compression is disabled
Policy routing is disabled
Network address translation is disabled
BGP Policy Mapping is disabled
WCCP Redirect outbound is disabled
WCCP Redirect inbound is disabled
WCCP Redirect exclude is disabled
16. show users
show users
命令用于显示当前登录设备的用户信息。这个命令可以帮助你了解哪些用户正在使用设备。
Router# show users
返回示例:
Line User Host(s) Idle Location
* 0 con 0 idle 00:00:00
1 vty 0 admin idle 00:01:23 192.168.1.100
17. show access-lists
show access-lists
命令用于显示设备的访问控制列表(ACL)信息。这个命令可以帮助你了解设备的ACL配置。
Router# show access-lists
返回示例:
Standard IP access list 1
10 permit 192.168.1.0, wildcard bits 0.0.0.255 (10 matches)
Extended IP access list 100
10 permit ip any any (20 matches)
20 deny ip 192.168.1.0 0.0.0.255 any (5 matches)
18. show ip dhcp binding
show ip dhcp binding
命令用于显示设备的DHCP绑定信息。这个命令可以帮助你了解设备的DHCP租约信息。
Router# show ip dhcp binding
返回示例:
IP address Client-ID/ Lease expiration Type
Hardware address
192.168.1.100 0100.1111.2222.33 Mar 01 2021 02:22 PM Automatic
192.168.1.101 0100.4444.5555.66 Mar 01 2021 02:23 PM Automatic
19. show ip dhcp pool
show ip dhcp pool
命令用于显示设备的DHCP池信息。这个命令可以帮助你了解设备的DHCP池配置。
Router# show ip dhcp pool
返回示例:
Pool DHCP_POOL1 :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
Leased addresses : 10
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased addresses
192.168.1.2 192.168.1.1 - 192.168.1.254 10
20. show ip eigrp neighbors
show ip eigrp neighbors
命令用于显示设备的EIGRP邻居信息。这个命令可以帮助你了解设备的EIGRP邻居状态。
Router# show ip eigrp neighbors
返回示例:
IP-EIGRP neighbors for process 100
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 10.1.1.2 Fa0/0 11 00:02:31 12 200 0 10
1 10.1.2.2 Fa0/1 14 00:02:20 10 200 0 11
21. show ip ospf neighbor
show ip ospf neighbor
命令用于显示设备的OSPF邻居信息。这个命令可以帮助你了解设备的OSPF邻居状态。
Router# show ip ospf neighbor
返回示例:
Neighbor ID Pri State Dead Time Address Interface
192.168.1.2 1 FULL/BDR 00:00:33 192.168.1.2 FastEthernet0/0
192.168.2.2 1 FULL/DR 00:00:35 192.168.2.2 FastEthernet0/1
22. show ip nat translations
show ip nat translations
命令用于显示设备的NAT转换表。这个命令可以帮助你了解设备的NAT转换情况。
Router# show ip nat translations
返回示例:
Pro Inside global Inside local Outside local Outside global
icmp 203.0.113.1:1234 192.168.1.2:1234 203.0.113.2:5678 203.0.113.2:5678
tcp 203.0.113.1:80 192.168.1.2:80 203.0.113.2:1024 203.0.113.2:1024
udp 203.0.113.1:53 192.168.1.2:53 203.0.113.2:1025 203.0.113.2:1025
23. show standby
show standby
命令用于显示设备的Hot Standby Router Protocol(HSRP)状态。这个命令可以帮助你了解设备的HSRP配置和状态。
Router# show standby
返回示例:
FastEthernet0/0 - Group 1
State is Active
2 state changes, last state change 00:00:42
Virtual IP address is 192.168.1.1
Active virtual MAC address is 0000.0c07.ac01
Local virtual MAC address is 0000.0c07.ac01 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.816 secs
Preemption enabled
Active router is local
Standby router is 192.168.1.2, priority 100 (expires in 9.632 sec)
Priority 150 (configured 150)
Group name is "hsrp-Fa0/0-1" (default)
24. show tech-support
show tech-support
命令用于显示设备的技术支持信息。这个命令可以帮助你了解设备的详细配置和状态,以便进行故障排查。
Router# show tech-support
返回示例:
由于show tech-support
命令的输出非常长,这里只给出部分示例:
...
FastEthernet0/0 is up, line protocol is up
Hardware is Gt96k FE, address is c201.4f00.0000 (bia c201.4f00.0000)
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, 100BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
1 packets input, 64 bytes, 0 no buffer
Received 1 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 1011 multicast, 0 pause input
0 input packets with dribble condition detected
589 packets output, 46676 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
...
25. show processes
show processes
命令用于显示设备的进程信息。这个命令可以帮助你了解设备的CPU使用情况和进程状态。
Router# show processes
返回示例:
CPU utilization for five seconds: 2%/0%; one minute: 2%; five minutes: 2%
PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process
1 4 106 37 0.00% 0.00% 0.00% 0 Chunk Manager
2 0 1 0 0.00% 0.00% 0.00% 0 Load Meter
3 0 2 0 0.00% 0.00% 0.00% 0 SpanTree Helper
4 0 1 0 0.00% 0.00% 0.00% 0 PrstVbl
5 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Syslog
6 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Test
7 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Identity
8 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Matlib
9 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Gold
10 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Env
11 0 1 0 0.00% 0.00% 0.00% 0 EEM ED ND
12 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Routing
13 0 1 0 0.00% 0.00% 0.00% 0 EEM ED OIR
14 0 1 0 0.00% 0.00% 0.00% 0 EEM ED FRU
15 0 1 0 0.00% 0.00% 0.00% 0 EEM ED IPC
16 0 1 0 0.00% 0.00% 0.00% 0 EEM ED RF
17 0 1 0 0.00% 0.00% 0.00% 0 EEM ED HA
18 0 1 0 0.00% 0.00% 0.00% 0 EEM ED IOSWD
19 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Config
20 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Counter
21 0 1 0 0.00% 0.00% 0.00% 0 EEM ED SNMP
22 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
23 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Timer
24 0 1 0 0.00% 0.00% 0.00% 0 EEM ED CLI
25 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
26 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Resource
27 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
28 0 1 0 0.00% 0.00% 0.00% 0 EEM ED Interface
29 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
30 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
31 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
32 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
33 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
34 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
35 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
36 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
37 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
38 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
39 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
40 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
41 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
42 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
43 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
44 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
45 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
46 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
47 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
48 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
49 0 1 0 0.00% 0.00% 0.00% 0 EEM ED None
26. show mac address-table
show mac address-table
命令用于显示设备的MAC地址表。这个命令可以帮助你了解设备的MAC地址表信息。
Router# show mac address-table
返回示例:
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 0000.0c07.ac01 DYNAMIC Fa0/1
10 0000.0c07.ac02 DYNAMIC Fa0/2
20 0000.0c07.ac03 DYNAMIC Fa0/3
30 0000.0c07.ac04 DYNAMIC Fa0/4
40 0000.0c07.ac05 DYNAMIC Fa0/5
在这个示例中,每一行都表示一个MAC地址条目。每个条目都包含VLAN编号、MAC地址、类型(静态或动态)以及MAC地址所在的端口。这些信息可以帮助你了解网络设备的网络拓扑和流量路径。请注意,实际的MAC地址表可能会根据网络设备的配置和网络流量的变化而变化。此外,不同的设备和操作系统可能会以不同的格式显示MAC地址表。
27. show spanning tree summary
show spanning tree summary
命令用于显示设备的生成树协议(STP)摘要信息。这个命令可以帮助你了解设备的STP状态。
Router# show spanning tree summary
返回示例:
Switch is in pvst mode
Root bridge for: VLAN0001, VLAN0002, VLAN0003
Extended system ID is enabled
Portfast Default is disabled
PortFast BPDU Guard Default is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default is disabled
EtherChannel misconfig guard is enabled
UplinkFast is disabled
Stack port is StackPort1
BackboneFast is disabled
Configured Pathcost method used is short
Name Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0001 0 0 0 5 5
VLAN0002 0 0 0 5 5
VLAN0003 0 0 0 5 5
---------------------- -------- --------- -------- ---------- ----------
3 vlans 0 0 0 15 15
28. show etherchannel
show etherchannel
命令用于显示设备的EtherChannel信息。这个命令可以帮助你了解设备的EtherChannel配置和状态。
Router# show etherchannel
返回示例:
Channel-group listing:
----------------------
Group: 1
----------
Group state = L2
Ports: 2 Maxports = 16
Port-channels: 1 Max Port-channels = 16
Protocol: LACP
Ports in the group:
-------------------
Port: Fa0/1
------------
Local information:
LACP port: Fa0/1 (Primary Port)
State: Active Channel group: 1
...
Port: Fa0/2
------------
Local information:
LACP port: Fa0/2
State: Active Channel group: 1
...
29. show vlan
show vlan
命令用于显示设备的VLAN信息。这个命令可以帮助你了解设备的VLAN配置和状态。
Router# show vlan
返回示例:
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
10 VLAN0010 active Fa0/5, Fa0/6, Fa0/7, Fa0/8
20 VLAN0020 active Fa0/9, Fa0/10, Fa0/11, Fa0/12
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
30. show vtp status
show vtp status
命令用于显示设备的VLAN Trunking Protocol(VTP)状态。这个命令可以帮助你了解设备的VTP配置和状态。
Router# show vtp status
返回示例:
VTP Version capable : 1 to 3
VTP version running : 1
VTP Domain Name : mydomain
VTP Pruning Mode : Disabled
VTP Traps Generation : Disabled
Device ID : 0000.0c07.ac00
Configuration last modified by 0.0.0.0 at 3-1-93 00:04:50
Local updater ID is 0.0.0.0 (no valid interface found)
Feature VLAN:
--------------
VTP Operating Mode : Server
Maximum VLANs supported locally : 1005
Number of existing VLANs : 5
Configuration Revision : 0
MD5 digest : 0x32 0x14 0x3E 0xEE 0x4A 0x41 0x52 0x5A
0x29 0x37 0x1C 0x1B 0x68 0x2F 0x94 0x22
31. show port-security
show port-security
命令用于显示设备的端口安全配置。这个命令可以帮助你了解设备的端口安全状态。
Router# show port-security
返回示例:
Port Security : Enabled
Port Status : Secure-up
Violation Mode : Shutdown
Aging Time : 0 mins
Aging Type : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses : 1
Total MAC Addresses : 1
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address:Vlan : 0000.0000.0001:1
Security Violation Count : 0
32. show monitor session all
show monitor session all
命令用于显示设备的所有SPAN(Switched Port Analyzer)会话。这个命令可以帮助你了解设备的SPAN会话配置和状态。
Router# show monitor session all
返回示例:
Session 1
---------
Type : Local Session
Source Ports :
Both : Fa0/1
Destination Ports : Fa0/2
Encapsulation : Native
Ingress : Disabled
33. show interfaces status
show interfaces status
命令用于显示设备的接口状态信息。这个命令可以帮助你了解设备的接口状态。
Router# show interfaces status
返回示例:
Port Name Status Vlan Duplex Speed Type
Fa0/1 connected a-full a-100 10/100BaseTX
Fa0/2 notconnect a-full a-100 10/100BaseTX
Fa0/3 connected a-full a-100 10/100BaseTX
Fa0/4 notconnect a-full a-100 10/100BaseTX
Fa0/5 connected a-full a-100 10/100BaseTX
Fa0/6 notconnect a-full a-100 10/100BaseTX
Fa0/7 connected a-full a-100 10/100BaseTX
Fa0/8 notconnect a-full a-100 10/100BaseTX
34. show interfaces switchport
show interfaces switchport
命令用于显示设备的交换机端口信息。这个命令可以帮助你了解设备的交换机端口配置和状态。
Router# show interfaces switchport
返回示例:
Name: Fa0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
35. show interfaces trunk
show interfaces trunk
命令用于显示设备的trunk接口信息。这个命令可以帮助你了解设备的trunk接口配置和状态。
Router# show interfaces trunk
返回示例:
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 1
Fa0/2 desirable 802.1q trunking 1
Port Vlans allowed on trunk
Fa0/1 1-4094
Fa0/2 1-4094
Port Vlans allowed and active in management domain
Fa0/1 1,10,20,30,40
Fa0/2 1,10,20,30,40
Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 1,10,20,30,40
Fa0/2 1,10,20,30,40
总结
文章最后,瑞哥给大家分类进行总结,方便大家快速查阅!
配置管理命令
- show running-config:显示当前设备的运行配置。
- show startup-configuration:显示设备启动时加载的配置。
网络状态查看命令
- show version:显示设备的软件版本信息。
- show ip route:显示设备的IP路由表。
- show ipv6 route:显示设备的IPv6路由表。
- show interfaces:显示设备的接口状态和统计信息。
- show ip interface brief:显示设备的IP接口摘要信息。
- show ipv6 interface brief:显示设备的IPv6接口摘要信息。
邻居和协议状态命令
- show cdp neighbors:显示设备邻居的CDP信息。
- show clock:显示设备的当前时间。
- show ntp status:显示NTP服务的状态。
- show protocols:显示设备的路由协议配置。
安全和监控命令
- show users:显示当前登录到设备的用户信息。
- show access-lists:显示设备的访问控制列表配置。
- show ip dhcp binding:显示DHCP绑定表,即IP地址分配情况。
- show ip dhcp pool:显示DHCP池的配置和使用情况。
- show ip eigrp neighbors:显示EIGRP邻居信息。
- show ip ospf neighbor:显示OSPF邻居信息。
- show ip nat translations:显示NAT转换表。
高可用性和性能优化命令
- show standby:显示设备的HSRP信息。
- show tech-support:显示设备的技术支持信息,用于故障排除。
- show processes:显示设备的进程信息。
- show mac address-table:显示设备的MAC地址表。
- show spanning tree summary:显示设备的STP摘要信息。
- show etherchannel:显示设备的EtherChannel信息。
VLAN和交换机配置命令
- show vlan:显示设备上的VLAN信息。
- show vtp status:显示VTP配置信息。
- show port-security:显示端口安全配置和统计信息。
- show monitor session all:显示监视会话的配置信息。
- show interfaces status:显示接口状态信息。
- show interfaces switchport:显示交换机接口的配置信息。
- show interfaces trunk:显示交换机的Trunk接口信息。