スポンサーリンク
スポンサーリンク

Cisco OSPF default-information originate【always】有りと無しの違い

【概要】

Cisco OSPF設定の default-information originate の[always] 有り、無しについて記事にします。
[always]が必須の場合と、無くても良い場合があります。
[always]が無い設定で、必要ないからとルータ上のデフォルトルートを削除すると恐らく大変なことになるでしょう。[always]有り、無しの違いと広報されるMericを把握することは重要です。

  ospf default-information originateとは

  • デフォルトルートをOSPFで広報する
    ※ redistribute ●●● subnetsではデフォルトルートを再配布できないため
  • ルーティングテーブル上にデフォルトルートがある事が前提
    ※ ルーティングテーブル上のデフォルトルートは Static / BGP / EIGRPなんでもOK

  ospf default-information originate alwaysとは

  • デフォルトルートをOSPFで広報する
    ※ redistribute ●●● subnetsでは デフォルトルートを再配布できないため
  • [always]有りの場合、ルーティングテーブル上にデフォルトルートが無くてもデフォルトルートをOSPFで広報する

構成 (「OSPF default-information originate」)

  • default-information originate
    ⇒ R2にでデフォルトルート(static)があるので、R2からデフォルトルートをOSPFで広報
  • default-information originate always
    ⇒R2にでデフォルトルートがなくても、R2からデフォルトルートをOSPFで広報

default-infomation

 config (Cisco CML)

R1-config <click<>/summary> <click<>
hostname R1
!
interface GigabitEthernet0/0
 ip address 10.12.1.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.12.1.2
!
control-plane
!
end
R2-config ( default-information originate) <click>
hostname R2
!
interface GigabitEthernet0/0
 ip address 10.12.1.2 255.255.255.0
!
interface GigabitEthernet0/1
 ip address 10.23.1.2 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 10.24.1.2 255.255.255.0
!
router ospf 1
 network 10.23.1.0 0.0.0.255 area 0
 network 10.24.1.0 0.0.0.255 area 0
 default-information originate
!
ip route 0.0.0.0 0.0.0.0 10.12.1.1
!
control-plane
!
end
R2-config ( default-information originate always) <click<>
hostname R2
!
interface GigabitEthernet0/0
 ip address 10.12.1.2 255.255.255.0
!
interface GigabitEthernet0/1
 ip address 10.23.1.2 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 10.24.1.2 255.255.255.0
!
router ospf 1
 network 10.23.1.0 0.0.0.255 area 0
 network 10.24.1.0 0.0.0.255 area 0
 default-information originate always
!
ip route 0.0.0.0 0.0.0.0 10.12.1.1
!
control-plane
!
end
R3-config <click<>
hostname R3
!
interface GigabitEthernet0/0
 ip address 10.23.1.3 255.255.255.0
 ip ospf cost 100
!
interface GigabitEthernet0/1
 ip address 10.35.1.3 255.255.255.0
 ip ospf cost 100
!
router ospf 1
 network 10.23.1.0 0.0.0.255 area 0
 network 10.35.1.0 0.0.0.255 area 0
 default-information originate
!
control-plane
!
end
R4-config <click<>
hostname R4
!
interface GigabitEthernet0/0
 ip address 10.24.1.4 255.255.255.0
 ip ospf cost 200
!
interface GigabitEthernet0/1
 ip address 10.45.1.4 255.255.255.0
 ip ospf cost 200
!
router ospf 1
 network 10.24.1.0 0.0.0.255 area 0
 network 10.45.1.0 0.0.0.255 area 0
!
control-plane
!
end
R5-config <click<>
hostname R5
!
interface GigabitEthernet0/0
 ip address 10.35.1.5 255.255.255.0
!
interface GigabitEthernet0/1
 ip address 10.45.1.5 255.255.255.0
!
router ospf 1
 network 10.35.1.0 0.0.0.255 area 0
 network 10.45.1.0 0.0.0.255 area 0
!
control-plane
!
end

show

R5#show ip route ospf
Gateway of last resort is 10.35.1.3 to network 0.0.0.0

O*E2  0.0.0.0/0 [110/1] via 10.35.1.3, 00:08:38, GigabitEthernet0/0
      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O        10.23.1.0/24 [110/101] via 10.35.1.3, 02:32:41, GigabitEthernet0/0
O        10.24.1.0/24 [110/102] via 10.35.1.3, 02:32:41, GigabitEthernet0/0
R5#
  • デフォルトルートを受信していることがわかる
  • Metricが1になる(Metric-typeはデフォルト”2”を設定)
  • BGPの場合、redistribute ●●● + default-information originate必要だが
    OSPFの場合、default-information originateのみでデフォルトルートを広報してくれる

まとめ

  • OSPFでデフォルトルートを広報する場合は、default-information originateを利用する
  • default-information originateと【+always】オプションが選択可能
  • default-information originateは、ルーティングテーブル上にデフォルトルートがあればデフォルトルートを広報する
  • default-information originate alwaysは、ルーティングテーブル上にデフォルトルートが無くてもデフォルトルートを広報する
  • default-information originateのMetric-type2で広報するとSEED-Metricは1になる
OSPFALL
スポンサーリンク
スポンサーリンク