网络工程师必知:35个思科设备show命令,排障利器!

简介: 【7月更文挑战第17天】

在网络工程领域,熟练掌握各种命令是网络工程师必备的技能之一。而在思科设备的管理和维护过程中,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

总结

文章最后,瑞哥给大家分类进行总结,方便大家快速查阅!

配置管理命令

  1. show running-config:显示当前设备的运行配置。
  2. show startup-configuration:显示设备启动时加载的配置。

网络状态查看命令

  1. show version:显示设备的软件版本信息。
  2. show ip route:显示设备的IP路由表。
  3. show ipv6 route:显示设备的IPv6路由表。
  4. show interfaces:显示设备的接口状态和统计信息。
  5. show ip interface brief:显示设备的IP接口摘要信息。
  6. show ipv6 interface brief:显示设备的IPv6接口摘要信息。

邻居和协议状态命令

  1. show cdp neighbors:显示设备邻居的CDP信息。
  2. show clock:显示设备的当前时间。
  3. show ntp status:显示NTP服务的状态。
  4. show protocols:显示设备的路由协议配置。

安全和监控命令

  1. show users:显示当前登录到设备的用户信息。
  2. show access-lists:显示设备的访问控制列表配置。
  3. show ip dhcp binding:显示DHCP绑定表,即IP地址分配情况。
  4. show ip dhcp pool:显示DHCP池的配置和使用情况。
  5. show ip eigrp neighbors:显示EIGRP邻居信息。
  6. show ip ospf neighbor:显示OSPF邻居信息。
  7. show ip nat translations:显示NAT转换表。

高可用性和性能优化命令

  1. show standby:显示设备的HSRP信息。
  2. show tech-support:显示设备的技术支持信息,用于故障排除。
  3. show processes:显示设备的进程信息。
  4. show mac address-table:显示设备的MAC地址表。
  5. show spanning tree summary:显示设备的STP摘要信息。
  6. show etherchannel:显示设备的EtherChannel信息。

VLAN和交换机配置命令

  1. show vlan:显示设备上的VLAN信息。
  2. show vtp status:显示VTP配置信息。
  3. show port-security:显示端口安全配置和统计信息。
  4. show monitor session all:显示监视会话的配置信息。
  5. show interfaces status:显示接口状态信息。
  6. show interfaces switchport:显示交换机接口的配置信息。
  7. show interfaces trunk:显示交换机的Trunk接口信息。
目录
相关文章
|
15天前
|
安全 物联网 定位技术
2G网络和基站的撤销对物联网设备的影响
2G网络和基站的撤销对物联网设备的影响是多方面的,以下是对这一影响的详细分析:
2G网络和基站的撤销对物联网设备的影响
|
8天前
|
传感器 物联网 人机交互
物联网:物联网,作为新一代信息技术的重要组成部分,通过智能感知、识别技术与普适计算等通信感知技术,将各种信息传感设备与互联网结合起来而形成的一个巨大网络,实现了物物相连、人物相连,开启了万物互联的新时代。
在21世纪,物联网(IoT)作为新一代信息技术的核心,正以前所未有的速度重塑生活、工作和社会结构。本文首先介绍了物联网的概念及其在各领域的广泛应用,强调其技术融合性、广泛的应用范围以及数据驱动的特点。接着,详细阐述了物联网行业的现状和发展趋势,包括政策支持、关键技术突破和应用场景深化。此外,还探讨了物联网面临的挑战与机遇,并展望了其未来在技术创新和模式创新方面的潜力。物联网行业正以其独特魅力引领科技发展潮流,有望成为推动全球经济发展的新引擎。
|
25天前
|
机器学习/深度学习 安全 网络协议
Web安全-Linux网络命令
Web安全-Linux网络命令
19 1
|
2月前
|
图形学 C#
超实用!深度解析Unity引擎,手把手教你从零开始构建精美的2D平面冒险游戏,涵盖资源导入、角色控制与动画、碰撞检测等核心技巧,打造沉浸式游戏体验完全指南
【8月更文挑战第31天】本文是 Unity 2D 游戏开发的全面指南,手把手教你从零开始构建精美的平面冒险游戏。首先,通过 Unity Hub 创建 2D 项目并导入游戏资源。接着,编写 `PlayerController` 脚本来实现角色移动,并添加动画以增强视觉效果。最后,通过 Collider 2D 组件实现碰撞检测等游戏机制。每一步均展示 Unity 在 2D 游戏开发中的强大功能。
82 6
|
1月前
|
缓存 运维 监控
|
4天前
|
存储 安全 网络安全
云计算与网络安全:技术融合下的信息安全新挑战
【9月更文挑战第29天】在数字化浪潮的推动下,云计算服务如雨后春笋般涌现,为各行各业提供了前所未有的便利和效率。然而,随着数据和服务的云端化,网络安全问题也日益凸显,成为制约云计算发展的关键因素之一。本文将从技术角度出发,探讨云计算环境下网络安全的重要性,分析云服务中存在的安全风险,并提出相应的防护措施。我们将通过实际案例,揭示如何在享受云计算带来的便捷的同时,确保数据的安全性和完整性。
|
4天前
|
SQL 安全 算法
网络安全与信息安全:关于网络安全漏洞、加密技术、安全意识等方面的知识分享
【9月更文挑战第29天】随着互联网的普及,网络安全问题日益严重。本文将介绍网络安全漏洞、加密技术以及安全意识等方面的内容,帮助读者了解网络安全的重要性,提高自身的网络安全意识。
|
4天前
|
存储 SQL 安全
网络安全与信息安全:构建安全防线的关键策略
本文深入探讨了网络安全与信息安全领域的核心要素,包括网络安全漏洞、加密技术以及安全意识的重要性。通过对这些关键领域的分析,旨在为读者提供一套综合性的防护策略,帮助企业和个人在日益复杂的网络环境中保障数据安全。
15 4
|
1天前
|
安全 网络协议 网络安全
网络安全与信息安全:漏洞、加密与意识的三重奏
【9月更文挑战第32天】在数字世界的交响乐中,网络安全是那不可或缺的乐章。本文将带您深入探索网络安全的三大主题:网络漏洞的识别与防范、加密技术的奥秘以及安全意识的重要性。通过深入浅出的方式,我们将一起揭开这些概念的神秘面纱,并学习如何在实际生活中应用它们来保护自己的数字足迹。让我们开始这场既刺激又富有教育意义的旅程,提升个人和组织的网络安全防御能力。
|
3天前
|
SQL 安全 程序员
网络安全与信息安全:关于网络安全漏洞、加密技术、安全意识等方面的知识分享
【9月更文挑战第30天】在数字化时代,网络安全和信息安全已成为全球关注的焦点。本文将探讨网络安全漏洞、加密技术以及提升安全意识的重要性。我们将通过代码示例,深入理解网络安全的基础知识,包括常见的网络攻击手段、防御策略和加密技术的实际应用。同时,我们还将讨论如何提高个人和企业的安全意识,以应对日益复杂的网络安全威胁。
下一篇
无影云桌面