Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ネットワーク構築訓練入門

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

 ネットワーク構築訓練入門

NTTソフトウェア社内のソフト道場研修で実施した、ネットワーク構築訓練入門研修のテキストです。

More Decks by NTTテクノクロス株式会社

Other Decks in Technology

Transcript

  1. カリキュラム 時間 研修内容 10:30 10:45 ◆Cisco IOSの概要 Cisco IOSのモードの説明、基本的なコマンドの理解 ◆スタティックルーティング

    IPルーティングの基本、スタティックルーティングの設定 【講義・演習1】 12:00 昼食 13:00 15:00 17:30 18:30 ◆スタティックルーティング IPルーティングの基本、スタティックルーティングの設定 ◆ダイナミックルーティング ルーティングプロトコルの基本(RIP、OSPF) ルーティングプロトコルの設定 ◆VLAN VLANの基本、VLANの設定 終了 【講義・演習2,3】 【講義・演習4,5】 【講義】 ~1日目~ ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 3
  2. カリキュラム 時間 研修内容 9:30 11:00 ◆VLAN(続き) ◆VLAN間ルーティング ルータによるVLAN間ルーティング 【演習6,7】 【講義】

    12:00 昼食 13:00 14:00 17:00 17:30 ◆VLAN間ルーティング(続き) L3スイッチによるVLAN間ルーティング ◆総合演習 ◆まとめ ◆研修環境clean up ◆アンケート記入 終了(最大延長 18:30) 【演習8】 【演習9,10】 ~2日目~ ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 4
  3. IOSとは(1)  「アイ・オー・エス」と発音する (「イオス」とか発音すると恥ずかしい思いをします・・・)  Internetwork Operating Systemの略 (apple社のiOSとは異なる) 

    Cisco製ハードウェアで動作する専用のOS  IOSのFeature(機能)、Versionは多くの種類が存在する  使用するFeature(機能)によりライセンス料金は大きな差が出る  IOSの選定はプロ(SIer、販社など)に相談して決めること  Ciscoゴールドパートナー企業であればベスト ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 6
  4. IOSとは(2)  IOSはソフトウェアなので必ずBugは存在することを意識しておく もちろん大きなBugは次versionなどで修正される (軽微なBugは修正されなかったりしますが・・・)  IOSの操作は、基本的にCLI(Command Line Interface)で行う SDMというGUIツールが提供されているが、Bugが多く、

    また使用すること自体が一般的でない  CLIは一見してUNIX/Linuxコマンドライクに見えるが、全く異なるコマンド体系  (基本的に)ファイルシステムの概念はない  モードの概念を理解する(次々項以降) ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 7
  5. Cisco IOSのモードを理解する ユーザモード Router> ルータ接続直後の画面 Enterキーを押す “enable”と入力する 特権モード Router# “configure

    terminal”と入力する グローバルコンフィグレーションモード Router(config)# インタフェース設定モード Router(config-if)# ルータ設定モード Router(config-router)# ライン設定モード Router(config-line)# ・ ・ “xxx”と入力する ※モード毎に異なる Enableパスワードを入力 ログインパスワードを入力 disable logout exit ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 9
  6. Cisco IOSのモードを理解する ユーザモード 統計情報を表示する。 ルータの基本的な状態の確認が可能である。 特権モード ルータのコンフィグレーションを表示する。 詳細な状態の確認やファイルの移動などが行える。 グローバル コンフィグレーションモード

    ルータに全体的な設定・変更を加えることができる。 項目別の設定モード (インタフェース設定モード、 ルータ設定モード、など) 項目別に詳細な設定・変更を行うことができる。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 10
  7. パスワードの設定 ~enable password~ Router(config)# enable secret nttsoft ~ユーザモードパスワード(コンソール)~ Router(config)# line

    console 0 Router(config-line)# login Router(config-line)# password nttsoft ~ユーザモードパスワード(Telnet)~ Router(config)# line vty 0 4 Router(config-line)# login Router(config-line)# password nttsoft ~パスワードの設定確認~ Router# show running-config ※表示されるパスワードを暗号化したい場合、 以下のコマンドを投入する。 Router(config)# service password-encryption ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 11
  8. その他の基本的なコマンド(1) ~ルータのホスト名を設定する~ Router(config)# hostname nttsoft ~バナーを設定する~ Router(config)# banner motd #

    Enter TEXT message. End with the character ‘#’. NTT SOFT doujou manages this router. # ~インタフェースメッセージを設定する~ Router(config)# interface ethernet 0 Router(config-if)# description doujou LAN ~コンフィグレーションの表示と保存~ Router# show running-config Router# copy running-config startup-config ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 12
  9. 補足  CLIでは、短縮入力、TABキー、ヘルプ「?」を多用し オペミス防止と作業効率向上を図る  History(上矢印キー)も使用可能  “copy run start”

    は “wr” で実施すると高効率化 “wr” コマンドは正しくは “write memory” コマンド ただし、最新IOS(Ver15.0以降)では “wr” コマンドは利用できない  endコマンド、doコマンドも活用する ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 14
  10. ルーティングテーブルの見方 F0/0 F0/0 F0/0 S0/0 S0/0 S0/0 S0/1 192.168.10.0/24 192.168.40.0/24

    192.168.50.0/24 192.168.20.0/24 192.168.30.0/24 R1 R2 R3 .1 .1 .2 .2 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 20
  11. ルーティングテーブルの見方 ~ルータ:R1のルーティングテーブル~ R1# show ip route [省略] S 192.168.50.0 [1/0]

    via 192.168.30.2 S 192.168.40.0 [1/0] via 192.168.20.2 C 192.168.30.0 is directly connected, Serial0/1 C 192.168.20.0 is directly connected, Serial0/0 C 192.168.10.0 is directly connected, FastEthernet0/0 ~ルータ:R2のルーティングテーブル~ R2# show ip route [省略] S 192.168.50.0 [1/0] via 192.168.20.1 C 192.168.40.0 is directly connected, FastEthernet0/0 S 192.168.30.0 [1/0] via 192.168.20.1 C 192.168.20.0 is directly connected, Serial0/0 S 192.168.10.0 [1/0] via 192.168.20.1 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 21
  12. ルーティングテーブルの見方 ~ルータ:R3のルーティングテーブル~ R3# show ip route [省略] C 192.168.50.0 is

    directly connected, FastEthernet0/0 S 192.168.40.0 [1/0] via 192.168.30.1 C 192.168.30.0 is directly connected, Serial0/0 S 192.168.20.0 [1/0] via 192.168.30.1 S 192.168.10.0 [1/0] via 192.168.30.1 アドミニストレーティブディスタンス/メトリックを示す。 ※ダイナミックルーティングの章で説明 S そのネットワークがスタティックエントリであることを示す。 C 直接接続されたネットワークであることを示す。 ネクストホップアドレスを示す。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 22
  13. インタフェースの設定 ~インタフェース設定モード~ (config)# interface [タイプ][スロット/ポート] ~IPアドレスの設定~ (config-if)# ip address [IPアドレス]

    [サブネットマスク] ※設定ミスなどを直すために設定情報を削除するときは”no ip address”を投入する。 ~インタフェースを有効化する~ (config-if)# no shutdown ~ルータ:R1のインタフェース設定~ R1(config)# interface fastethernet 0/0 R1(config-if)# ip address 192.168.10.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# interface serial 0/0 R1(config-if)# ip address 192.168.20.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# interface serial 0/1 R1(config-if)# ip address 192.168.30.1 255.255.255.0 R1(config-if)# no shutdown ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 23
  14. インタフェースの設定 ~ルータ:R2のインタフェース設定~ R2(config)# interface fastethernet 0/0 R2(config-if)# ip address 192.168.40.1

    255.255.255.0 R2(config-if)# no shutdown R2(config-if)# interface serial 0/0 R2(config-if)# ip address 192.168.20.2 255.255.255.0 R2(config-if)# no shutdown ~ルータ:R3のインタフェース設定~ R3(config)# interface fastethernet 0/0 R3(config-if)# ip address 192.168.50.1 255.255.255.0 R3(config-if)# no shutdown R3(config-if)# interface serial 0/0 R3(config-if)# ip address 192.168.30.2 255.255.255.0 R3(config-if)# no shutdown ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 24
  15. インタフェースの設定 ~インタフェース状態の確認~ R1# show ip interface brief Interface IP-Address OK?

    Method Status Protocol FastEthernet0/0 192.168.10.1 YES manual up up Serial0/0 192.168.20.1 YES manual up up Serial0/1 192.168.30.1 YES manual up up R2# show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.40.1 YES manual up up Serial0/0 192.168.20.2 YES manual up up Serial0/1 unassigned YES NVRAM administratively down down R3# show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.50.1 YES manual up up Serial0/0 192.168.30.2 YES manual up up Serial0/1 unassigned YES manual administratively down down Statusは物理的な状態、Protocolは論理的な状態を表す。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 25
  16. スタティックルートの設定 (config)# ip route [destination_network][mask][next_hop_address] [administrative_distance][permanent] destination_network : 宛先ネットワークを示す。 mask

    : そのネットワークで使用されるサブネットマスクを示す。 next_hop_address : 宛先ネットワークへ転送する直接接続されたルータのアドレスを示す。 administrative_distance : スタティックルートの場合はデフォルト”1”である。 (※ダイナミックルーティングの章で説明) permanent : 状態に無関係でルーティングテーブルに保持される ※administrative_distance、およびpermanentパラメータについてはオプションである。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 26
  17. スタティックルートの設定 ~ルータ:R1のスタティックルートの設定~ R1(config)# ip route 192.168.40.0 255.255.255.0 192.168.20.2 R1(config)# ip

    route 192.168.50.0 255.255.255.0 192.168.30.2 ~ルータ:R2のスタティックルートの設定~ R2(config)# ip route 192.168.10.0 255.255.255.0 192.168.20.1 R2(config)# ip route 192.168.30.0 255.255.255.0 192.168.20.1 R2(config)# ip route 192.168.50.0 255.255.255.0 192.168.20.1 ~ルータ:R3のスタティックルートの設定~ R3(config)# ip route 192.168.10.0 255.255.255.0 192.168.30.1 R3(config)# ip route 192.168.20.0 255.255.255.0 192.168.30.1 R3(config)# ip route 192.168.40.0 255.255.255.0 192.168.30.1 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 27
  18. デフォルトルートの設定 デフォルトルーティングは、ルーティングテーブルに存在しないネットワークを宛先とする パケットを、次のホップのルータへ送信するために使用する。 ~ルータ:R3のデフォルトルートの設定~ R3(config)# no ip route 192.168.10.0 255.255.255.0

    192.168.30.1 R3(config)# no ip route 192.168.20.0 255.255.255.0 192.168.30.1 R3(config)# no ip route 192.168.40.0 255.255.255.0 192.168.30.1 R3(config)# ip route 0.0.0.0 0.0.0.0 192.168.30.1 R3# show ip route [省略] Gateway of last resort is 192.168.30.1 to network 0.0.0.0 C 192.168.50.0 is directly connected, FastEthernet0/0 C 192.168.30.0 is directly connected, Serial0/0 S* 0.0.0.0/0 [1/0] via 192.168.30.1 ※デフォルトルートを設定する際、”ip classless”コマンドを投入する必要がある。 IOSのバージョンが新しいもの(11.3以降)はデフォルトでオンとなっているが、古いバージョン では、オンとなっていない可能性がある。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 28
  19. RIP(Router Information Protocol)  RIP  Router Information Protocolの略 

    古い(レガシーな)ルーティングプロトコル  ほとんどの場合、標準ライセンスで使用可能  中小規模NW向け  コンバージェンス(収束)に時間がかかる 最大150秒  ホップ数をメトリックとして利用 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 30
  20. RIPの動作 F0/0 F0/1 F0/1 192.168.10.0/24 192.168.20.0/24 R1 R3 ネットワーク ネクストホップ

    メトリック IF 192.168.10.0/24 - 0 F0/0 192.168.20.0/24 - 0 F0/1 192.168.30.0/24 192.168.40.0/24 F0/1 R2 F0/0 F0/0 ネットワーク ネクストホップ メトリック IF 192.168.30.0/24 - 0 F0/0 192.168.40.0/24 - 0 F0/1 ネットワーク ネクストホップ メトリック IF 192.168.20.0/24 - 0 F0/0 192.168.30.0/24 - 0 F0/1 【R1】 【R2】 【R3】 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 31
  21. RIPの動作 F0/0 F0/1 F0/1 192.168.10.0/24 192.168.20.0/24 R1 R3 192.168.30.0/24 192.168.40.0/24

    F0/1 R2 F0/0 F0/0 ネットワーク 192.168.10.0/24 192.168.20.0/24 メトリック 0 0 ネットワーク 192.168.30.0/24 192.168.40.0/24 メトリック 0 0 ネットワーク 192.168.20.0/24 192.168.30.0/24 メトリック 0 0 ネットワーク 192.168.20.0/24 192.168.30.0/24 メトリック 0 0 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 32
  22. RIPの動作 F0/0 F0/1 F0/1 192.168.10.0/24 192.168.20.0/24 R1 R3 ネットワーク ネクストホップ

    メトリック IF 192.168.10.0/24 - 0 F0/0 192.168.20.0/24 - 0 F0/1 192.168.30.0/24 192.168.40.0/24 F0/1 R2 F0/0 F0/0 ネットワーク ネクストホップ メトリック IF 192.168.30.0/24 - 0 F0/0 192.168.40.0/24 - 0 F0/1 ネットワーク ネクストホップ メトリック IF 192.168.20.0/24 - 0 F0/0 192.168.30.0/24 - 0 F0/1 【R1】 【R2】 【R3】 192.168.30.0/24 192.168.20.2 1 F0/1 192.168.20.0/24 192.168.30.1 1 F0/0 192.168.10.0/24 192.168.20.1 1 F0/0 192.168.40.0/24 192.168.30.2 1 F0/1 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 33
  23. RIPの動作 F0/0 F0/1 F0/1 192.168.10.0/24 192.168.20.0/24 R1 R3 192.168.30.0/24 192.168.40.0/24

    F0/1 R2 F0/0 F0/0 ネットワーク 192.168.40.0/24 メトリック 1 ネットワーク 192.168.10.0/24 メトリック 1 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 34
  24. RIPの動作 F0/0 F0/1 F0/1 192.168.10.0/24 192.168.20.0/24 R1 R3 ネットワーク ネクストホップ

    メトリック IF 192.168.10.0/24 - 0 F0/0 192.168.20.0/24 - 0 F0/1 192.168.30.0/24 192.168.40.0/24 F0/1 R2 F0/0 F0/0 ネットワーク ネクストホップ メトリック IF 192.168.30.0/24 - 0 F0/0 192.168.40.0/24 - 0 F0/1 ネットワーク ネクストホップ メトリック IF 192.168.20.0/24 - 0 F0/0 192.168.30.0/24 - 0 F0/1 【R1】 【R2】 【R3】 192.168.30.0/24 192.168.20.2 1 F0/1 192.168.20.0/24 192.168.30.1 1 F0/0 192.168.10.0/24 192.168.20.1 1 F0/0 192.168.40.0/24 192.168.30.2 1 F0/1 192.168.40.0/24 192.168.20.2 2 F0/1 192.168.10.0/24 192.168.30.1 2 F0/0 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 35
  25. RIPルーティングの設定 F0/0 F0/0 F0/0 S0/0 S0/0 S0/0 S0/1 192.168.10.0/24 192.168.40.0/24

    192.168.50.0/24 192.168.20.0/24 192.168.30.0/24 R1 R2 R3 .1 .1 .2 .2 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 36
  26. RIPルーティングの設定 ~ルータ:R1のRIPルーティングの設定~ R1(config)# router rip R1(config-router)# network 192.168.10.0 R1(config-router)# network

    192.168.20.0 R1(config-router)# network 192.168.30.0 R1(config-router)# passive-interface fastethernet 0/0 ~ルータ:R2のRIPルーティングの設定~ R2(config)# router rip R2(config-router)# network 192.168.20.0 R2(config-router)# network 192.168.40.0 R2(config-router)# passive-interface fastethernet 0/0 直接接続されたネットワーク ごとにコマンドを入力する RIP更新のメッセージが 送信されない ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 37
  27. RIPルーティングの設定 ~ルータ:R3のRIPルーティングの設定~ R3(config)# router rip R3(config-router)# network 192.168.30.0 R3(config-router)# network

    192.168.50.0 R3(config-router)# passive-interface fastethernet 0/0 ※RIPをバージョン2で動作させたい場合は、”version 2”コマンドをルータ設定モードで投入する。 (config-router)# version 2 ~ルートの自動集約~ (config-router)# auto-summary ※デフォルトで有効となっている (config-router)# no auto-summary ※自動集約を解除したい場合に投入する ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 38
  28. RIPルーティングの確認 ~ルータ:R1のルーティングテーブル~ R1# show ip route [省略] R 192.168.50.0 [120/1]

    via 192.168.30.2, 00:00:00, Serial0/1 R 192.168.40.0 [120/1] via 192.168.20.2, 00:00:00, Serial0/0 C 192.168.30.0 is directly connected, Serial0/1 C 192.168.20.0 is directly connected, Serial0/0 C 192.168.10.0 is directly connected, FastEthernet0/0 ~ルータ:R2のルーティングテーブル~ R2# show ip route [省略] R 192.168.50.0 [120/2] via 192.168.20.1, 00:00:00, Serial0/0 C 192.168.40.0 is directly connected, FastEthernet0/0 R 192.168.30.0 [120/1] via 192.168.20.1, 00:00:00, Serial0/0 C 192.168.20.0 is directly connected, Serial0/0 R 192.168.10.0 [120/1] via 192.168.20.1, 00:00:00, Serial0/0 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 39
  29. RIPルーティングの確認 ~ルータ:R3のルーティングテーブル~ R3# show ip route [省略] C 192.168.50.0 is

    directly connected, FastEthernet0/0 R 192.168.40.0 [120/2] via 192.168.30.1, 00:00:00, Serial0/0 C 192.168.30.0 is directly connected, Serial0/0 R 192.168.20.0 [120/1] via 192.168.30.1, 00:00:00, Serial0/0 R 192.168.10.0 [120/1] via 192.168.30.1, 00:00:00, Serial0/0 アドミニストレーティブディスタンス/メトリックを示す。 R RIPルーティングプロトコルにて動的に追加されたネットワークであることを示す。 ネクストホップアドレスを示す。 RIP更新メッセージを受信したインタフェースを示す。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 40
  30. RIPルーティングの確認 ~ルーティングプロトコルの確認~ R1# show ip protocols Routing protocol is “rip”

    Sending updates every 30 seconds, next due in 6 seconds Invalid after 180 seconds, hold down 180, flushed after 240 [省略] Default version control: send version 1, receive any version Interface Send Recv Key-chain Serial0/0 1 1 Serial0/1 1 1 Routing for Networks: 192.168.10.0 192.168.20.0 192.168.30.0 Routing Information Sources: [省略] RIPで使用するタイマ RIPのバージョン 設定したネットワーク ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 41
  31. RIPルーティングの確認 ~デバッグコマンド~ R1# debug ip rip RIP protocol debugging is

    on R1# 00:00:00: RIP: received v1 update from 192.168.20.2 on Serial0/0 00:00:00: 192.168.40.0 in 1 hops 00:00:01: RIP: received v1 update from 192.168.30.2 on Serial0/1 00:00:01: 192.168.50.0 in 1 hops 00:00:03: RIP: sending v1 update to 255.255.255.255 via Serial0/0 (192.168.20.1) 00:00:03: subnet 192.168.50.0, metric 2 00:00:03: subnet 192.168.30.0, metric 1 00:00:03: subnet 192.168.10.0, metric 1 00:00:03: RIP: sending v1 update to 255.255.255.255 via Serial0/1 (192.168.30.1) 00:00:03: subnet 192.168.40.0, metric 2 00:00:03: subnet 192.168.20.0, metric 1 00:00:03: subnet 192.168.10.0, metric 1 R1# undebug all All possible debugging has been turned off ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 42
  32. OSPF(Open Shortest Path First)  OSPF  Open Shortest Path

    Firstの略  比較的新しいルーティングプロトコル  ほとんどの場合、追加ライセンスの購入が必要  大中規模NW向け  コンバージェンス(収束)は数秒  各リンクのコストを算出して選択 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 43
  33. OSPFの動作 10 10.1.0.0/16 10.2.0.0/16 R1 R4 ネットワーク ネクストホップ メトリック IF

    10.1.0.0/16 - 10 F0/0 192.168.12.0/24 - 10 F0/1 10.4.0.0/16 10.3.0.0/16 R2 【R1】 R3 10 10 10 10 20 20 10 10 10 10 10 192.168.12.0/24 192.168.13.0/24 192.168.24.0/24 192.168.34.0/24 192.168.13.0/24 - 10 F0/2 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 44
  34. OSPFの動作 10 10.1.0.0/16 10.2.0.0/16 R1 R4 10.4.0.0/16 10.3.0.0/16 R2 R3

    10 10 20 10 10 192.168.12.0/24 192.168.13.0/24 192.168.24.0/24 192.168.34.0/24 10 10 ここは最短ではないので使われない R1ルータをルートとした SPFツリー ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 45
  35. OSPFの動作 10 10.1.0.0/16 10.2.0.0/16 R1 R4 ネットワーク ネクストホップ メトリック IF

    10.1.0.0/16 - 10 F0/0 192.168.12.0/24 - 10 F0/1 10.4.0.0/16 10.3.0.0/16 R2 【R1】 R3 10 10 10 10 20 20 10 10 10 10 10 192.168.12.0/24 192.168.13.0/24 192.168.24.0/24 192.168.34.0/24 192.168.13.0/24 - 10 F0/2 ネットワーク ネクストホップ メトリック IF 192.168.24.0/24 192.168.12.2 30 F0/1 192.168.34.0/24 192.168.13.2 20 F0/2 10.3.0.0/16 192.168.13.2 20 F0/2 10.2.0.0/16 192.168.12.2 20 F0/1 10.4.0.0/16 192.168.13.2 30 F0/2 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 46
  36. OSPFの説明 ~隣接関係(neighbor)~ 各ルータは自身が保持している接続情報を他ルータと交換することでルーティングテーブル を構築する。 ~代表ルータ(DR、BDR)~ OSPFでは、全ルータとフルメッシュで接続情報を交換することはせず、代表ルータを介して 他ルータの接続情報を得る。隣接関係は代表ルータとのみ結ぶ。 代表ルータ(DR)は最も大きい優先度を持つルータが選出される。また、2番目に大きい 優先度を持つルータがバックアップ(BDR)ルータとして選出される。 (config-if)#

    ip ospf priority [priority値] 優先度が同一の場合はルータIDの大きいものが代表ルータとして選出される。 ルータIDは以下のコマンドで明示的に設定することができるが、設定されていない場合は、 ループバックアドレスもしくはアクティブなIFのアドレスが適用される。 (config-router)# router-id [A.B.C.D] ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 47
  37. OSPFルーティングの設定 F0/0 F0/0 F0/0 S0/0 S0/0 S0/0 S0/1 192.168.10.0/24 192.168.40.0/24

    192.168.50.0/24 192.168.20.0/24 192.168.30.0/24 R1 R2 R3 .1 .1 .2 .2 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 50
  38. OSPFルーティングの設定 (config)# router ospf [process-id] process-id : OSPFプロセスIDを示す。ローカルでのみ意味を持つ。 (config-router)# network

    [network_address] [wildcard_mask] area [area-id] network_address & wildcard_mask : 指定したアドレスを持つインタフェースに対して OSPFを有効にする。 area-id : 指定したインタフェースが属するエリアを示す。 (例) (config-router)# network 192.168.0.0 0.0.255.255 area 0 ⇒192.168.x.xのIPアドレスのインタフェースでOSPFが有効になり、そのインタフェースは エリア0に属する。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 51
  39. OSPFルーティングの設定 ~ルータ:R1のOSPFルーティングの設定~ R1(config)# router ospf 1 R1(config-router)# network 192.168.10.0 0.0.0.255

    area 0 R1(config-router)# network 192.168.20.0 0.0.0.255 area 0 R1(config-router)# network 192.168.30.0 0.0.0.255 area 0 ~ルータ:R2のOSPFルーティングの設定~ R2(config)# router ospf 1 R2(config-router)# network 192.168.20.0 0.0.0.255 area 0 R2(config-router)# network 192.168.40.0 0.0.0.255 area 0 ~ルータ:R3のOSPFルーティングの設定~ R3(config)# router ospf 1 R3(config-router)# network 192.168.30.0 0.0.0.255 area 0 R3(config-router)# network 192.168.50.0 0.0.0.255 area 0 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 52
  40. OSPFルーティングの確認 ~ルータ:R1のルーティングテーブル~ R1# show ip route [省略] O 192.168.50.0 [110/1564]

    via 192.168.30.2, 00:00:00, Serial0/1 O 192.168.40.0 [110/1564] via 192.168.20.2, 00:00:00, Serial0/0 C 192.168.30.0 is directly connected, Serial0/1 C 192.168.20.0 is directly connected, Serial0/0 C 192.168.10.0 is directly connected, FastEthernet0/0 ~ルータ:R2のルーティングテーブル~ R2# show ip route [省略] O 192.168.50.0 [110/3126] via 192.168.20.1, 00:00:00, Serial0/0 C 192.168.40.0 is directly connected, FastEthernet0/0 O 192.168.30.0 [110/3125] via 192.168.20.1, 00:00:00, Serial0/0 C 192.168.20.0 is directly connected, Serial0/0 O 192.168.10.0 [110/1564] via 192.168.20.1, 00:00:00, Serial0/0 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 53
  41. OSPFルーティングの確認 ~ルータ:R3のルーティングテーブル~ R3# show ip route [省略] C 192.168.50.0 is

    directly connected, FastEthernet0/0 O 192.168.40.0 [110/3126] via 192.168.30.1, 00:00:00, Serial0/0 C 192.168.30.0 is directly connected, Serial0/0 O 192.168.20.0 [110/3125] via 192.168.30.1, 00:00:00, Serial0/0 O 192.168.10.0 [110/1564] via 192.168.30.1, 00:00:00, Serial0/0 O OSPFルーティングプロトコルにて動的に追加されたネットワークであることを示す。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 54
  42. OSPFルーティングの確認 ~ルーティングプロトコルの確認~ R1# show ip protocols Routing protocol is “ospf

    1” [省略] Router ID 192.168.30.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa maximum path: 1 Routing for Networks: 192.168.10.0 0.0.0.255 area 0 192.168.20.0 0.0.0.255 area 0 192.168.30.0 0.0.0.255 area 0 Routing Information Sources: [省略] ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 55
  43. OSPFルーティングの確認 ~OSPF情報の確認~ R1# show ip ospf Routing Process “ospf 1”

    with ID 192.168.30.1 [省略] Number of areas in this router is 1. 1 normal 0 stub 0 nssa [省略] R1# show ip ospf interface Serial0/0 is up, line protocol is up Internet Address 192.168.20.1/24, Area 0 Process ID 1, Router ID 192.168.30.1, Network Type POINT_TO_POINT, Cost: 1563 [省略] FastEthernet0/0 is up, line protocol is up Internet Address 192.168.10.1/24, Area 0 Process ID 1, Router ID 192.168.30.1, Network Type BROADCAST, Cost: 1 [省略] ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 56
  44. OSPFルーティングの確認 ~OSPF情報の確認~ R1# show ip ospf neighbor Neighbor ID Pri

    State Dead Time Address Interface 192.168.40.1 1 FULL/- 00:00:00 192.168.20.2 Serial0/0 192.168.50.1 1 FULL/- 00:00:00 192.168.30.2 Serial0/1 ネイバーのルータIDを示す。 ネイバーとのOSPFステータスを示す。 (FULLはリンクステートデータベースの交換が 完了している) ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 57
  45. VLANの説明の前に・・・(1) みなさん、以下の機器の違いを説明できますか? • ハブ • スイッチ • L2スイッチ • L3スイッチ

    なんとなく理解しているけど、明確に違いを理解していて それを第三者に説明できる人は案外少なかったりします。 次項以降で、それぞれの違いを説明します。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 60
  46. VLANの識別 ~ISL (Inter-Switch Link)~ Cisco独自のトランキングプロトコル。26bytesのISLヘッダと4bytesのFCS (Frame Check Sequence)を追加する。 ~IEEE 802.1Q~

    IEEE標準のトランキングプロトコル。4bytesのタグを追加する。 ネイティブVLAN(デフォルトは1)が規定されており、ネイティブVLANのフレームを転送する ときはタグが追加されない。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 67
  47. VLANの設定 VLAN 10 VLAN 20 VLAN 10 VLAN 20 SW1

    SW2 SW3 F0/0 F0/1 F0/0 F0/1 F0/23 F0/23 F0/0 F0/1 VLAN 10 : GROUP10 VLAN 20 : GROUP20 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 68
  48. VLANの設定 ~VLANの作成~ (config)# vlan [vlan-id] (config-vlan)# name [vlan-name] ※VLANの名前の設定は必須ではない。 ~インタフェースへの適用~

    (config-if)# switchport mode access (config-if)# switchport access vlan [vlan-id] 複数のインタフェースに同じVLANを適用する場合、rangeコマンドによりまとめて設定する ことができる (config)# interface range fastethernet 0/0-23 ※ポート0から23までを設定 (config-if-range)# switchport mode access (config-if-range)# switchport access vlan 10 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 69
  49. VLANの設定 ~スイッチ:SW1およびSW2のVLANの設定~ SW1(config)# vlan 10 SW1(config-vlan)# name GROUP10 SW1(config-vlan)# vlan

    20 SW1(config-vlan)# name GROUP20 SW1(config)# interface fastethernet 0/0 SW1(config-if)# switchport mode access SW1(config-if)# switchport access vlan 10 SW1(config-if)# interface fastethernet 0/1 SW1(config-if)# switchport mode access SW1(config-if)# switchport access vlan 20 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 70
  50. VLANの設定 ~トランクリンクの設定~ (config-if)# switchport mode trunk (config-if)# switchport trunk encapsulation

    {dot1q | isl} ~スイッチ:SW1およびSW2のトランクリンクの設定~ SW1(config)# interface fastethernet 0/23 SW1(config-if)# switchport mode trunk SW1(config-if)# switchport trunk encapsulation dot1q ~スイッチ:SW3のトランクリンクの設定~ SW3(config)# interface range fastethernet 0/0-1 SW3(config-if-range)# switchport mode trunk SW3(config-if-range)# switchport trunk encapsulation dot1q ※トランクリンクに流すVLANトラフィックを指定することもできる (config-if)# switchport trunk allowed vlan [vlan-id] ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 71
  51. VLANの確認 ~スイッチ:SW1およびSW2のVLANの確認~ SW1# show vlan VLAN Name Status Ports -------

    ------------------------- ----------- ----------------------------------------- 1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5 [省略] 10 GROUP10 active Fa0/0 20 GROUP20 active Fa0/1 [省略] VLAN Type SAID MTU ・・・ ------- ----------- ----------- ------ ----------------------------------------- 1 enet 100001 1500 ・・・ 続けてVLAN番号またはVLAN名を指定 して、特定の情報を表示しても良い。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 72
  52. VLANの確認 ~スイッチ:SW1およびSW2のVLANの確認~ SW1# show vlan brief VLAN Name Status Ports

    ------- ------------------------- ----------- ----------------------------------------- 1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5 [省略] 10 GROUP10 active Fa0/0 20 GROUP20 active Fa0/1 [省略] briefを付けるとVLAN情報の要約を 表示することが出来る。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 73
  53. VLANの確認 ~スイッチ:トランクリンクの確認~ SW1# show interface trunk Port Mode Encapsulation Status

    Native vlan Fa0/23 on 802.1q trunking 1 [省略] SW3# show interface trunk Port Mode Encapsulation Status Native vlan Fa0/0 on 802.1q trunking 1 Fa0/1 on 802.1q trunking 1 [省略] ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 74
  54. ルータによるVLAN間ルーティングの設定 VLAN 10 VLAN 20 VLAN 10 VLAN 20 SW1

    SW2 SW3 F0/0 F0/1 F0/0 F0/1 F0/23 F0/23 F0/0 F0/1 VLAN 10 : 192.168.10.0/24 VLAN 20 : 192.168.20.0/24 R1 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 76
  55. ルータによるVLAN間ルーティングの設定 ルータの物理インタフェースごとに異なるVLANを収容する方法が考えられるが、ルータの インタフェース数よりも多くのVLANを使用する場合は適用できない。 その場合、1つの物理インタフェースだけでVLAN間ルーティングを可能にする方法がある。 これを「棒上のルータ」(router-on-a-stick)と呼ぶ。 ※トランク対応ルータであることが条件となる。 ~ルータの設定~ R1(config)# interface fastethernet

    0/0.1 R1(config-subif)# encapsulation dot1Q 10 R1(config-subif)# ip address 192.168.10.1 255.255.255.0 R1(config-subif)# interface fastethernet 0/0.2 R1(config-subif)# encapsulation dot1Q 20 R1(config-subif)# ip address 192.168.20.1 255.255.255.0 サブインタフェース番号を示す。 カプセル化の方法、およびVLAN 番号を示す。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 77
  56. L3スイッチによるVLAN間ルーティングの設定 VLAN 10 VLAN 20 VLAN 10 VLAN 20 SW1

    SW2 F0/0 F0/1 F0/0 F0/1 F0/23 F0/23 F0/0 F0/1 SW3 VLAN 10 : 192.168.10.0/24 VLAN 20 : 192.168.20.0/24 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 78
  57. L3スイッチによるVLAN間ルーティングの設定 L3スイッチはスイッチにルータの機能が具備されていることから、単体でVLAN間ルーティング を可能にする。 ~L3スイッチの設定~ SW3(config)# ip routing SW3(config)# interface vlan

    10 SW3(config-if)# ip address 192.168.10.1 255.255.255.0 SW3(config)# interface vlan 20 SW3(config-if)# ip address 192.168.20.1 255.255.255.0 ~スイッチ:SW3のルーティングテーブルの確認~ R1# show ip route [省略] C 192.168.10.0 is directly connected, Vlan10 C 192.168.20.0 is directly connected, Vlan20 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 79
  58. 参考情報(役に立つコマンド) ~--More-- を非表示にする ~ Router# terminal length 0 ~ソフトウェアバージョンやハードウェアの基本情報を表示する~ Router#

    show version ~ハードウェア情報を表示する(IOS12.3(4)Tから提供されたコマンド)~ Router# show inventory ~シスコのサポート(TAC)に解析依頼する際の情報を出力する~ Router# show tech-support ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 81
  59. 参考情報(役に立つコマンド) ~拡張ping ~ Router# ping ~拡張traceroute~ Router# traceroute ~ログ確認~ Router#

    show logging ~CPU使用率の確認~ Router# show process cpu ~メモリ使用率の確認~ Router# show process memory ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 82
  60. 参考情報(役に立つコマンド) ~DNSサーバに対して名前解決を行わないようにする~ Router(config)# no ip domain-lookup ※デフォルトでは名前解決をするようになっている。コマンドミスも名前解決処理を行って しまい、タイムアウトするまで待たされてしまうため、解除しておくか明確にDNSサーバ を指定(ip name-serverコマンド)するかを行った方が良い。

    ~ログアウト時間を変更する(コンソールポート用コマンド)~ Router(config)# line console 0 Router(config-line)# exec-timeout {分} {秒} ※デフォルトは10分である。 ※分と秒を共に”0”で設定すると、自動的にログアウトされないようにできる。 ~入力途中のコマンドを再表示する(コンソールポート用コマンド) ~ Router(config)# line console 0 Router(config-line)# logging synchronous ※入力途中にポップアップメッセージが入っても再表示を行ってくれる。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 83
  61. 参考情報(パスワードを復旧する) 1. ルータをブートした後、ブレイク(Ctrl + Breakキー)を実行してブートシーケンスを中断する。 System Bootstrap, Version 11.3(2)XA4, RELEASE

    SOFTWARE (fc1) … monitor: command “boot” aborted due to user interrupt rommon 1 > 2. コンフィギュレーションレジスタのビット6をオン(0x2102→0x2142)にする。 rommon 1 > confreg 0x2142 3. ルータを再ロード(resetを入力)する。 4. 特権モードに入る。 5. startup-configファイルをrunnning-configファイルにコピーする。 copy startup-config running-config 6. パスワードを変更する。 7. コンフィギュレーションレジスタをデフォルト値に戻す。 config t config-register 0x2102 copy running-config startup-config 8. ルータを再ロードする。 ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 84
  62. 参考情報(シスコ技術者認定) http://www.cisco.com/web/JP/learning/certifications/index.html 5つの認定レベル エントリーレベルから、アソシエイト、プロフェッショナル、エキスパート(CCIE / CCDE)、 最上級レベルのアーキテクトまで、5つのレベルで構成されています。 8つの分野 ルーティング &

    スイッチング、ネットワーク セキュリティ、サービス プロバイダといった分野 (コース)が複数用意されており、それぞれの職務分担や業界にとって適切な認定試験を 受けることができます。 CCENT CCNA CCNP CCIE エントリーレベル アソシエイト プロフェッショナル エキスパート アーキテクト ※ルーティング&スイッチングの場合を 示す。 アーキテクトレベルはデザイン分野 のみとなる。 今回の研修レベル ネットワーク構築訓練入門 Copyright© 2016 NTT Software Corporation 85