iosospf

動的(ダイナミック)ルーティングの1つであるOSPFについて説明します。ルーターはネットワーク間を接続していますが、経路を制御する仕事も担っています。リンクステート型であるOSPFは、全てのルーターが同じ経路情報を持っている様にする方法です。しかし、ネットワークが大きすぎるとルーターにかかる負荷が大きくなるため、エリアというグループに分けて管理するのが一般的です。

目次

OSPF(Open Shortest Path First)とは

  • Open Shortest Path Firstの略
  • 中(大)規模NW向け
  • 追加ライセンスが必要な場合がある。
  • コンバージェンス(収束)は比較的早い。
  • ルーターが増えるごとに、負荷が指数関数的に増える。
  • リンクステート型
  • コスト計算にルータ間の通信速度が含まれる。
  • エリアごとに経路情報を作成・管理する。
  • 代表ルーター(DR)とバックアップルーター(BDR)がある。

OSPFの設定コマンド

OSPFの有効化
(config)# router ospf [process-id]

  process-id:OSPFルーティングプロセスを識別するためのID。1 ~ 65535 の範囲で指定。

OSPFで管理するネットワーク(インターフェース)とエリアの指定
(config-router)# network [address] [wildcard] area [area-id]

  address :ネットワークアドレスまたはインターフェースのIPアドレスで設定。
  wildcard:上記アドレスを読み取るためのワイルカードマスクの指定。
  area-id :割り当てたいエリアを指定。

OSPFルーティングの設定の例

※シングルエリアでの設定例
iospic1

RIPルーティングの設定

ルータ:R1のOSPFルーティングの設定
  Router(config)#router ospf 1
  Router(config-router)#network 192.168.10.0 0.0.0.255 area 0
  Router(config-router)#network 192.168.20.0 0.0.0.255 area 0
  Router(config-router)#network 192.168.30.0 0.0.0.255 area 0

ルータ:R2のOSPFルーティングの設定
  Router(config)#router ospf 1
  Router(config-router)#network 192.168.20.0 0.0.0.255 area 0
  Router(config-router)#network 192.168.40.0 0.0.0.255 area 0

ルータ:R3のOSPFルーティングの設定
  Router(config)#router ospf 1
  Router(config-router)#network 192.168.30.0 0.0.0.255 area 0
  Router(config-router)#network 192.168.50.0 0.0.0.255 area 0

RIPルーティングの確認

ルータ:R1のルーティングテーブル
  R1# show ip route
  [省略]
  O 192.168.50.0 [110/2] via 192.168.30.2, 00:00:00, Serial0/1
  O 192.168.40.0 [110/2] 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/3] 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/2] 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/2] via 192.168.20.1, 00:00:00, Serial0/0

ルータ:R3のルーティングテーブル
  R3# show ip route
  [省略]
  O 192.168.40.0 [110/3] via 192.168.20.1, 00:00:00, Serial0/0
  C 192.168.50.0 is directly connected, FastEthernet0/0
  O 192.168.20.0 [110/2] via 192.168.20.1, 00:00:00, Serial0/0
  C 192.168.30.0 is directly connected, Serial0/0
  O 192.168.10.0 [110/2] via 192.168.20.1, 00:00:00, Serial0/0

ネクストホップアドレスを示す。
アドミニストレーティブディスタンス/メトリックを示す。
O そのネットワークがOSPFエントリであることを示す。
C 直接接続されたネットワークであることを示す。

ルーティングプロトコルの確認

R1#sh ip prot

Routing Protocol is “ospf 1”
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 192.168.30.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
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:
Gateway Distance Last Update
192.168.30.1 110 00:13:17
192.168.40.1 110 00:13:38
192.168.50.1 110 00:13:18
Distance: (default is 110)

 
 
Cisco IOSカテゴリーのトップページは、Cisco IOSです。