10 · Starting a Switch啟動交換器

Basic show Commands and Information基本 show 指令與資訊

After you log into a Cisco switch, you can verify the switch software and hardware status by using several commands that you execute from privileged EXEC mode. These commands include the show interfaces, show version, and show running-config commands. Here is a look at each of these commands in more detail.

登入 Cisco 交換器後,你可以在特權 EXEC 模式下執行多個指令,以驗證交換器的軟體與硬體狀態。這些指令包括 show interfacesshow versionshow running-config。以下逐一詳細介紹這些指令。

Switch show interfaces Command

交換器 show interfaces 指令

The show interfaces command displays the status and statistical information for the network interfaces of the switch. The resulting output varies, depending on the network for which a particular interface has been configured. You usually enter this command with the options type and slot/number. The type option allows values such as FastEthernet and GigabitEthernet. The slot/number option indicates the slot number and the port number on the selected interface (for example, fa0/1).

show interfaces 指令會顯示交換器網路介面的狀態與統計資訊。輸出結果會因特定介面所設定的網路而有所不同。你通常會搭配 typeslot/number 選項來輸入此指令。type 選項可接受 FastEthernet、GigabitEthernet 等數值;slot/number 選項則指出所選介面的插槽編號與連接埠編號(例如 fa0/1)。

SwitchX# show interfaces FastEthernet 0/1
FastEthernet0/1 is up, line protocol is up (connected) 
 Hardware is Fast Ethernet, address is 001e.147c.bd01 (bia 001e.147c.bd01)
  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, media type is 10/100BaseTX
  input flow-control is off, output flow-control is unsupported
  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 31000 bits/sec, 33 packets/sec
  5 minute output rate 28000 bits/sec, 31 packets/sec
     11369 packets input, 1326880 bytes, 0 no buffer
     Received 317 broadcasts (317 multicasts)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 317 multicast, 0 pause input
     0 input packets with dribble condition detected
     21701 packets output, 2538278 bytes, 0 underruns
 --More--

The table shows some of the fields in the example display that you will find useful for verifying fundamental switch details:

下表列出範例輸出中一些有助於驗證交換器基本詳細資訊的欄位:

Fundamental Switch Details

交換器基本詳細資訊

Output
輸出
Description
說明
FastEthernet0/1 is up, line protocol is up (connected)
FastEthernet0/1 is up, line protocol is up (connected)
Indicates the status of the interface. The first part is the hardware status, and the second part is the line protocol. The hardware status is the status of the OSI physical layer, and the line protocol is the status of the OSI data link layer; together, the two are the status of the TCP/IP link layer. In this example, the entire link layer is active and ready; In other words, the interface can send and receive frames. This state is referred to as "up/up." Note that if the hardware is down, the line protocol will also be down.
表示介面的狀態。第一部分為硬體狀態,第二部分為線路協定狀態。硬體狀態是 OSI 實體層的狀態,線路協定則是 OSI 資料鏈結層的狀態;兩者合併即為 TCP/IP 鏈結層的狀態。在此範例中,整個鏈結層皆為作用中且就緒;換句話說,該介面可以收發框架。此狀態稱為「up/up」。請注意,若硬體狀態為 down,線路協定也會顯示為 down。
Hardware is Fast Ethernet, address is 001e.147c.bd01
Hardware is Fast Ethernet, address is 001e.147c.bd01
Indicates the MAC address of the interface.
表示該介面的 MAC 位址。
Full-duplex, 100 Mbps
Full-duplex, 100 Mbps
Shows the type and mode of connection. Other possibilities include half-duplex and 10 Mbps.
顯示連線的類型與模式,其他可能的值包括半雙工與 10 Mbps。
5-minute input rate, 31,000 bps
5-minute input rate, 31,000 bps
Reports interface traffic statistics for average input rate.
回報介面流量統計中的平均輸入速率。

Switch show version Command

交換器 show version 指令

You can use the show version Cisco IOS command in privileged EXEC mode to verify the Cisco IOS Software version and release numbers of the Cisco IOS Software that is running on a Cisco switch.

你可以在特權 EXEC 模式下使用 show version 這個 Cisco IOS 指令,以驗證 Cisco 交換器上執行的 Cisco IOS 軟體版本與發行編號。

SwitchX# show version
Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(1)SE3, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Wed 30-May-12 14:26 by prod_rel_team
ROM: Bootstrap program is C2960 boot loader
BOOTLDR: C2960 Boot Loader (C2960-HBOOT-M) Version 12.2(44)SE6, RELEASE SOFTWARE (fc1)
SwitchX uptime is 15 hours, 30 minutes
System returned to ROM by power-on
System restarted at 15:06:49 UTC Tue Aug 21 2012
System image file is "flash:/c2960-lanbasek9-mz.150-1.SE3/c2960-lanbasek9-mz.150-1.SE3.bin"
cisco WS-C2960-24TT-L (PowerPC405) processor (revision D0) with
65536K bytes of memory. 
Processor board ID FOC1141Z8YW 
Last reset from power-on
1 Virtual Ethernet interface
24 FastEthernet interfaces
2 Gigabit Ethernet interfaces
The password-recovery mechanism is enabled.
<... output omitted ...>

The following table describes some of the output fields of the show version command:

下表說明 show version 指令輸出的部分欄位:

Output Fields from the show version Command

show version 指令的輸出欄位

Output
輸出
Description
說明
Cisco IOS Software version
Cisco IOS 軟體版本
Identification of the software by name and version number Always specify the complete version number when reporting a possible software problem. In this example, the switch is running Cisco IOS Release 15.0(1)SE3.
以名稱與版本號識別軟體。回報可能的軟體問題時,務必提供完整的版本號。在此範例中,交換器執行的是 Cisco IOS Release 15.0(1)SE3。
Switch uptime
交換器運作時間
Current days and time since the system was last booted In this example, the switch uptime is 15 hours and 30 minutes.
系統自上次開機以來經過的天數與時間。在此範例中,交換器的運作時間為 15 小時 30 分鐘。
System image file
系統映像檔
System image name and file location (local or remote filesystem)
系統映像檔名稱與檔案位置(本地或遠端檔案系統)
Switch platform
交換器平台
Hardware platform information, including revision and amount of RAM
硬體平台資訊,包括版本與 RAM 容量
Processor board ID
處理器板卡 ID
Device serial number
裝置序號

Switch show running-config Command

交換器 show running-config 指令

The show running-config command displays the current running (active) configuration file of the switch. This command requires privileged EXEC mode access. This command displays the IPv4 address, subnet mask, and default gateway settings, if they are configured:

show running-config 指令會顯示交換器目前執行中(active)的設定檔。此指令需要特權 EXEC 模式的存取權限。若已設定,此指令會顯示 IPv4 位址、子網路遮罩與預設閘道設定:

SwitchX# show running-config
Building configuration...

Current configuration: 1750 bytes
!
! Last configuration change at 08:51:52 UTC Wed Aug 22 2012
! NVRAM config last updated at 06:26:14 UTC Wed Aug 22 2012
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SwitchX 
<... output omitted ...>
interface FastEthernet0/1
<... output omitted ...>
interface Vlan1
 ip address 172.20.137.5 255.255.255.0 
!
ip default-gateway 172.20.137.1 
<... output omitted ...>
Which command will display the switch uptime information?哪個指令可用來顯示交換器的運作時間資訊?