14 · Configuring a Cisco Router設定 Cisco 路由器

Checking Interface Configuration and Status檢查介面設定與狀態

When you have completed the router interface configuration, you can verify the configuration using various show commands.

完成路由器介面設定後,您可以使用各種 show 指令來驗證設定。

You can view information about interfaces by using several commands:

您可以使用以下幾個指令來檢視介面資訊:

  • show ip interface brief: A brief list of interfaces and their IPv4 addressesshow ip interface brief介面及其 IPv4 位址的簡要清單
  • show protocols type interface-identifier: Brief details about a particular interfaceshow protocols type interface-identifier特定介面的簡要詳細資訊
  • show interfaces: Details about all the interfaces (for example, packets flowing in and out of the interface)show interfaces所有介面的詳細資訊(例如流入與流出介面的封包)
  • Optionally, you can include the interface type and slot/interface number on many commands:您也可以在許多指令中選擇加入介面類型與插槽/介面編號:
    • show interfaces type interface-identifier:Details for a specific interfaceshow interfaces type interface-identifier特定介面的詳細資訊

The following examples show sample outputs from the presented commands.

以下範例顯示上述指令的範例輸出。

RouterY# show ip  interface brief
Interface           IP-Address      OK? Method  Status              Protocol
FastEthernet0/0     10.1.1.1        YES manual  up                       up
FastEthernet0/1     unassigned      YES unset   administratively    down down
Serial0/0/0         unassigned      YES unset   administratively    down down
Serial0/0/1         unassigned      YES unset   up                       up
Serial0/1/0         unassigned      YES unset   up                       up
Serial0/1/1         unassigned      YES unset   administratively    down down

The following table shows the output fields and their meanings.

下表列出輸出欄位及其意義。

Output Field
輸出欄位
Description
說明
Interface
Interface
Type of specific interface
特定介面的類型
IP Address
IP Address
IPv4 address that is assigned to the interface.
指派給該介面的 IPv4 位址。
OK?
OK?
"Yes" means that the IPv4 address is valid; "No" means that the IPv4 address is invalid.
「Yes」表示 IPv4 位址有效;「No」表示 IPv4 位址無效。
Method
Method
Describes how the IPv4 address was obtained or configured.
說明 IPv4 位址的取得方式或設定方式。
Status
Status
Indicates the physical layer status of the interface.
顯示介面的實體層狀態。
Protocol
Protocol
Indicates the data link layer status of the interface.
顯示介面的資料鏈結層狀態。
R2# show protocols Ethernet 0/0
Ethernet0/0 is up, line protocol is up
Internet address is 10.10.2.1/24
RouterX# show interfaces
GigabitEthernet0/0 is up, line protocol is up
  Hardware is CN Gigabit Ethernet, address is f866.f231.7250 (bia f866.f231.7250) 
  Description: Link to ISP 
  Internet address is 192.168.2.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, 100Mbps, media type is RJ45 
  output flow-control is unsupported, input flow-control is unsupported 
  ARP type: ARPA, ARP Timeout 04:00:00 
  Last input 00:00:53, output 00:00:09, 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 
<... output omitted ...>

The table shows some of the output fields for a Gigabit Ethernet interface and their meanings in this example.

下表以此範例中的 Gigabit Ethernet 介面為例,列出部分輸出欄位及其意義。

Output
輸出
Description
說明
GigabitEthernet...is {up | down | administratively down}

Line protocol is
{up | down}
GigabitEthernet...is {up | down | administratively down}

Line protocol is
{up | down}
Indicates whether the interface hardware is currently active, down, or if an administrator has taken it down. Please refer to the Troubleshooting Status Codes table for an explanation of all the combinations of these two statuses.
指出介面硬體目前是啟用中、關閉,或已被管理者關閉。請參閱疑難排解狀態代碼表,了解這兩種狀態所有組合的說明。
Hardware
Hardware
Displays the hardware type and MAC address.
顯示硬體類型與 MAC 位址。
Description
Description
Displays the configured interface description.
顯示已設定的介面描述。
Internet address
Internet address
Displays the IPv4 address followed by the prefix length (subnet mask).
顯示 IPv4 位址及其後的前綴長度(子網路遮罩)。
MTU
MTU
Displays the maximum transmission unit (MTU) of the interface.
顯示介面的最大傳輸單元(MTU)。
BW
BW
Shows the bandwidth of the interface in kilobits per second. The bandwidth parameter is used to compute routing protocol metrics and other calculations.
以每秒千位元顯示介面的頻寬。頻寬參數用於計算路由協定度量值及其他運算。
DLY
DLY
Shows the delay of the interface in microseconds. This parameter is used to compute routing protocol metrics and other calculations.
以微秒顯示介面的延遲。此參數用於計算路由協定度量值及其他運算。
Rely
Rely
Displays the reliability of the interface as a fraction of 255 (255/255 is 100% reliability). This parameter is used to compute routing protocol metrics and other calculations.
以 255 為基準顯示介面的可靠性(255/255 表示 100% 可靠)。此參數用於計算路由協定度量值及其他運算。
Load
Load
Displays the load on the interface as a fraction of 255 (255/255 is completely saturated). This parameter is used to compute routing protocol metrics and other calculations.
以 255 為基準顯示介面的負載(255/255 表示已完全飽和)。此參數用於計算路由協定度量值及其他運算。
Encapsulation
Encapsulation
Shows the encapsulation method that is used on the interface.
顯示該介面所使用的封裝方式。
5-minute input rate,
5-minute output rate
5-minute input rate,
5-minute output rate
Shows the average number of bits and packets that the interface transmitted per second in the last 5 minutes.
顯示過去 5 分鐘內該介面每秒傳輸的平均位元數與封包數。

Each of the command outputs shown in the previous examples lists two interface status codes. For a router to use an interface, the two interface status codes on the interface must be in the up state. The first status code refers to whether the physical layer (Layer 1) is working, and the second status code mainly (but not always) refers to whether the data link layer (Layer 2) protocol is working.

先前範例中每個指令輸出都列出兩個介面狀態代碼。路由器要使用某個介面,該介面上的兩個狀態代碼都必須是啟用(up)狀態。第一個狀態代碼指出實體層(第 1 層)是否運作正常,第二個狀態代碼主要(但不一定)指出資料鏈結層(第 2 層)通訊協定是否運作正常。

Four combinations of settings exist for the status codes when troubleshooting a network. The following table lists the four combinations and an explanation of the typical reasons why an interface would be in this state. As you review the list, note that if the hardware status (the first status code) is not "up," the second will always be "down" because the data link layer functions cannot work if the physical layer has a problem.

在排除網路問題時,狀態代碼共有四種設定組合。下表列出這四種組合,以及介面處於該狀態的常見原因說明。檢視此清單時請注意,若硬體狀態(第一個狀態代碼)不是「up」,第二個狀態一定會是「down」,因為若實體層有問題,資料鏈結層的功能就無法運作。

Troubleshooting Status Codes with Four Combinations of Settings

四種設定組合的疑難排解狀態代碼

Hardware and Line Protocol Status
硬體與線路協定狀態
Typical Reasons
常見原因
administratively down, down
administratively down, down
The interface has a shutdown command that is configured on it.
該介面已設定 shutdown 指令。
down, down
down, down
The interface has a no shutdown command that is configured, but the physical layer has a problem. For example, no cable has been attached to the interface, or with Ethernet, the switch interface on the other end of the cable is shut down, or the switch is powered off.
該介面已設定 no shutdown 指令,但實體層出現問題。例如,介面未接上纜線,或在乙太網路情境中,纜線另一端的交換器介面被關閉,或該交換器已斷電。
up, down
up, down
Almost always refers to data link layer problems, most often configuration problems. For example, serial links have this combination when one router is configured to use one protocol, and the other defaults to use another.
幾乎都是資料鏈結層問題,最常見的是設定問題。例如,當一台路由器設定使用某種協定,而另一台預設使用另一種協定時,序列鏈路就會出現這種組合。
up, up
up, up
All is well, and the interface is functioning.
一切正常,介面正常運作。
Which three options represent possible indicators to describe the state of the interface hardware? (Choose three.)下列哪三個選項代表描述介面硬體狀態時可能出現的指標?(選三項)