CCNA試験対策 ch7 Configuring and Verifying Switch Interfaces

CCNAネットワーク勉強メモ

ch7 Configuring and Verifying Switch Interfaces

Configuring Switch Interfaces

  • interfaceごとの設定

Configuring Speed, Duplex, and Description

  • duplex {auto|full|half}

    • 全二重/半二重
  • speed {auto|10|100|1000}

    • bps
Switch>enable
Switch#show interfaces status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        notconnect   1          auto    auto  10/100BaseTX
Fa0/2                        notconnect   1          auto    auto  10/100BaseTX
Fa0/3                        notconnect   1          auto    auto  10/100BaseTX
Fa0/4                        notconnect   1          auto    auto  10/100BaseTX
Fa0/5                        notconnect   1          auto    auto  10/100BaseTX
Fa0/6                        notconnect   1          auto    auto  10/100BaseTX
Fa0/7                        notconnect   1          auto    auto  10/100BaseTX
Fa0/8                        notconnect   1          auto    auto  10/100BaseTX
Fa0/9                        notconnect   1          auto    auto  10/100BaseTX
Fa0/10                       notconnect   1          auto    auto  10/100BaseTX
Fa0/11                       notconnect   1          auto    auto  10/100BaseTX
Fa0/12                       notconnect   1          auto    auto  10/100BaseTX
Fa0/13                       notconnect   1          auto    auto  10/100BaseTX
Fa0/14                       notconnect   1          auto    auto  10/100BaseTX
Fa0/15                       notconnect   1          auto    auto  10/100BaseTX
Fa0/16                       notconnect   1          auto    auto  10/100BaseTX
Fa0/17                       notconnect   1          auto    auto  10/100BaseTX
Fa0/18                       notconnect   1          auto    auto  10/100BaseTX
Fa0/19                       notconnect   1          auto    auto  10/100BaseTX
Fa0/20                       notconnect   1          auto    auto  10/100BaseTX
Fa0/21                       notconnect   1          auto    auto  10/100BaseTX
Fa0/22                       notconnect   1          auto    auto  10/100BaseTX
Fa0/23                       notconnect   1          auto    auto  10/100BaseTX
Fa0/24                       notconnect   1          auto    auto  10/100BaseTX
Gig0/1                       notconnect   1          auto    auto  10/100BaseTX
Gig0/2                       notconnect   1          auto    auto  10/100BaseTX
  • 設定

    • f0/1をプリンタ用に、full duplex 100bpsに
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface FastEthernet 0/1
Switch(config-if)#
Switch(config-if)#duplex full
Switch(config-if)#speed 100
Switch(config-if)#description Printer on 3rd floor
Switch(config-if)#exit
  • f0/11 - 20にdescription
Switch(config)#interface range FastEthernet 0/11 - 20
Switch(config-if-range)#description end-users connect here
Switch(config-if-range)#exit
Switch(config)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
  • 確認
Switch#show interfaces status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        notconnect   1          a-full  a-100 10/100BaseTX
Fa0/2                        notconnect   1          auto    auto  10/100BaseTX
Fa0/3                        notconnect   1          auto    auto  10/100BaseTX
Fa0/4                        notconnect   1          auto    auto  10/100BaseTX
Fa0/5                        notconnect   1          auto    auto  10/100BaseTX
Fa0/6                        notconnect   1          auto    auto  10/100BaseTX
Fa0/7                        notconnect   1          auto    auto  10/100BaseTX
Fa0/8                        notconnect   1          auto    auto  10/100BaseTX
Fa0/9                        notconnect   1          auto    auto  10/100BaseTX
Fa0/10                       notconnect   1          auto    auto  10/100BaseTX
Fa0/11                       notconnect   1          auto    auto  10/100BaseTX
Fa0/12                       notconnect   1          auto    auto  10/100BaseTX
Fa0/13                       notconnect   1          auto    auto  10/100BaseTX
Fa0/14                       notconnect   1          auto    auto  10/100BaseTX
Fa0/15                       notconnect   1          auto    auto  10/100BaseTX
Fa0/16                       notconnect   1          auto    auto  10/100BaseTX
Fa0/17                       notconnect   1          auto    auto  10/100BaseTX
Fa0/18                       notconnect   1          auto    auto  10/100BaseTX
Fa0/19                       notconnect   1          auto    auto  10/100BaseTX
Fa0/20                       notconnect   1          auto    auto  10/100BaseTX
Fa0/21                       notconnect   1          auto    auto  10/100BaseTX
  • Packet Tracerだとnameにdescriptionが反映されないっぽい?

Configuring Multiple interfaces with the interface range Command

Switch(config)#interface range FastEthernet 0/11 - 20
Switch(config-if-range)#description end-users connect here
Switch(config-if-range)#exit
  • これ

Administratively Controlling Interface State with shutdown

  • interfaceのON/OFF切り替え
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#shutdown

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
Switch(config-if)#
Switch(config-if)#exit
Switch(config)#interface FastEthernet0/1
show interfaces f0/1 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        disabled 1          a-full  a-100 10/100BaseTX

Removing Configuration with the no Command

Switch#show interfaces f0/2 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/2                        notconnect   1          a-full  a-100 10/100BaseTX
  • 設定リセット
Switch(config)#int f0/2
Switch(config-if)#no speed
Switch(config-if)#no duplex
Switch(config-if)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
  • 確認
show interfaces f0/2 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/2                        notconnect   1          auto    auto  10/100BaseTX

Autonegotiation

  • speed, duplexを自動でよしなに決めるやつ

Autonegotiation Under Working Conditions

  • 送信/受信側でspeedが一致していないと正しく通信できない
  • IEEE autonegotiation (802.3u)

    • switch/ホストNIC両者が同じspeed/duplex設定を選択するようにnegotiateするプロトコル
    • 通常の(データ伝送用の)電気周波数から外れた帯域を用いて、各ノードどの規格で伝送できるか伝えあう
    • switch 「10/100/1000をサポートしています」
    • PC 「10/100をサポートしています」
    • => 100BASE-T

Autonegotiation Results When Only One Node Uses Autonegotiation

  • IEEE標準では、autonegotiationに失敗したときの挙動も定義されている

    • speed
    • サポートしている速度のうち、最低のもの
    • duplex
    • speedが10,100ならばhalf duplex

      • CSMA/CDを使用する
    • そうでなければ、full duplex
  • Ciscoではこれを拡張

    • speed
    • autonegotiationによらない方法で、相手の速度を検出し、それに合わせる
    • 失敗したら標準と同じ
    • duplex
    • 標準と同じ

Autonegotiation and LAN Hubs

  • LAN Hubs (リピータハブ、L1)はautonegotiation messageに反応しない

    • 接続されている機器に取り次ぐこともしない
  • ので、LAN Hubsに接続された機器はautonegotiationがオフの状態と同じ

Analyzing Switch Interface Status and Statistics

Interface Status Codes and Reasons for Nonworking States

  • 接続あり
Switch#show interfaces f0/1 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        connected    1          auto    auto  10/100BaseTX
Switch>show interfaces f0/1
FastEthernet0/1 is up, line protocol is up (connected)
  Hardware is Lance, address is 0001.433b.2c01 (bia 0001.433b.2c01)
...
  • 接続なし
Switch#show interfaces f0/2 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/2                        notconnect   1          auto    auto  10/100BaseTX
Switch>show interfaces f0/2
FastEthernet0/2 is down, line protocol is down (disabled)
  Hardware is Lance, address is 0001.433b.2c02 (bia 0001.433b.2c02)
...
  • interfaceをshutdown
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fastEthernet0/1
Switch(config-if)#shutdown

Switch(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

Switch(config-if)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show interfaces f0/1 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        disabled 1          auto    auto  10/100BaseTX
Switch#show interfaces f0/1
FastEthernet0/1 is administratively down, line protocol is down (disabled)
  Hardware is Lance, address is 0001.433b.2c01 (bia 0001.433b.2c01)
...

まとめ

Line Status Protocol Status Interface Status 典型的な理由
administratively down down disabled interface configでのshutdownコマンド
down down disabled いろいろ(*)
up down notconnect 接続なし
down down (err-disabled) err-disabled ポートセキュリティ無効
up up connected 正常動作
  • (*)

    • ケーブル不良、またはそもそも接続なし
    • pinout間違い
    • speedミスマッチ
    • 接続先デバイスが…
    • 電源オフ
    • shutdown
    • エラーで無効になっている

Interface Speed and Duplex Issues

  • show interfaces, show interfaces statusの対比
  • Duplex と Speed の値がどのようにして設定されたかはshow interfaces statusでないとわからない

    • enableモード限定
Switch#show interfaces f0/1 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        connected    1          auto    auto  10/100BaseTX
  • Packet Tracerだとならなかったが、autonegotizationが効いていると、DuplexやSpeedがa-fulla-100のようになるらしい
  • Duplex, Speedの実際の値はshow interfacesコマンドでわかる

    • ほか、show interfacesでないと得られない情報も
Switch#show interfaces f0/1
FastEthernet0/1 is up, line protocol is up (connected)
  Hardware is Lance, address is 0001.433b.2c01 (bia 0001.433b.2c01)
 BW 100000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s
  input flow-control is off, output flow-control is off
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:08, output 00:00:05, 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
     956 packets input, 193351 bytes, 0 no buffer
     Received 956 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     2357 packets output, 263570 bytes, 0 underruns
     0 output errors, 0 collisions, 10 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
  • duplex mismatchはspeed mismatchよりも検出しづらい

    • line status/protocol status上はup/upで正常動作に見えてしまう
  • 見つけ方

    • 両端ノードのduplex設定が一致していることを確認する
    • collision/late collisionの増加を観察する

Common Layer 1 Problems on Working Interfaces

  • up/up状態だと、「正常動作」と判断し、各種エラーをカウントする

    • runts
    • < 64 B より小さいため廃棄されたフレームの数

      • collisionで生じうる
    • giants
    • 1518 B より大きいため廃棄されたフレームの数

      • 6: Source MAC Address
      • 6: Destination MAC Address
      • 2: Type
      • 4: FCS
      • 1500: 残り
    • input errors
    • 入力にまつわる各種エラーカウントの合計
    • CRC
    • CRC不一致エラー回数
    • packet outputs
    • output errors
    • 出力にまつわる各種エラーカウントの合計
    • collisions
    • 衝突・再送信数
    • late collision
    • プリアンブル送信後に発生するコリジョンの発生件数

      • half duplexが設定されている側で、データを64B送ったあとに、同一のinterfaceで受信を検知したらカウント