NSSAエリアへの default information-originate広報





条件
・R4 はすべてのネットワークに接続するためには R2もしくはR3 を通らなければなりません。
 そのためR4はOSPF外部ルートは学ばず、OSPF内部ルートのみ学ぶように設定してください。
・またOSPF外部ルートへ接続するためには R3 を通るように設定してください。



まず下記設定からスタートです。

R1
interface Serial1/0
ip add 12.12.12.1 255.255.255.0
no shut

interface Serial1/1
ip add 13.13.13.1 255.255.255.0
no shut

interface lo0
ip add 10.10.10.10 255.255.255.255

router ospf 1
net 12.12.12.0 0.0.0.255 area 0
net 13.13.13.0 0.0.0.255 area 0
net 10.10.10.10 0.0.0.0 area 0

R2
interface Serial1/0
ip add 12.12.12.2 255.255.255.0
no shut

interface Serial1/1
ip add 24.24.24.2 255.255.255.0
no shut

interface F0/0
ip add 23.23.23.2 255.255.255.0
no shut

router ospf 1
net 12.12.12.0 0.0.0.255 area 0
net 23.23.23.0 0.0.0.255 area 0
net 24.24.24.0 0.0.0.255 area 234

R3
interface Serial1/0
ip add 34.34.34.3 255.255.255.0
no shut

interface Serial1/1
ip add 13.13.13.3 255.255.255.0
no shut

interface F0/0
ip add 23.23.23.3 255.255.255.0
no shut

router ospf 1
net 34.34.34.0 0.0.0.255 area 234
net 13.13.13.0 0.0.0.255 area 0
net 23.23.23.0 0.0.0.255 area 0

R4
interface Serial1/0
ip add 34.34.34.4 255.255.255.0
no shut

interface Serial1/1
ip add 24.24.24.4 255.255.255.0
no shut

router ospf 1
net 34.34.34.0 0.0.0.255 area 234
net 24.24.24.0 0.0.0.255 area 234



上記状態で、R4 にて sh ip route をみてみます。


R4#sh ip route
Gateway of last resort is not set

     34.0.0.0/24 is subnetted, 1 subnets
C       34.34.34.0 is directly connected, Serial1/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.23.23.0 [110/65] via 34.34.34.3, 00:01:02, Serial1/0
                   [110/65] via 24.24.24.2, 00:01:02, Serial1/1
     24.0.0.0/24 is subnetted, 1 subnets
C       24.24.24.0 is directly connected, Serial1/1
     10.0.0.0/32 is subnetted, 1 subnets
O E2    10.10.10.10 [110/20] via 34.34.34.3, 00:00:00, Serial1/0
                    [110/20] via 24.24.24.2, 00:00:00, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.12.12.0 [110/128] via 24.24.24.2, 00:01:02, Serial1/1
     13.0.0.0/24 is subnetted, 1 subnets
O IA    13.13.13.0 [110/128] via 34.34.34.3, 00:01:10, Serial1/0

すべてのOSPF内部エリアと外部エリアが見えることがわかりますね。

まず一つ目の条件ですが、OSPF内部ルート(O IA)は学べて、外部ルート (O E1,2) は学ばないという
ことでおなじみの NSSA を設定します。

R2,3,4
router ospf 1
area 234 nssa



R4#sh ip route
Gateway of last resort is not set

     34.0.0.0/24 is subnetted, 1 subnets
C       34.34.34.0 is directly connected, Serial1/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.23.23.0 [110/65] via 34.34.34.3, 00:02:47, Serial1/0
                   [110/65] via 24.24.24.2, 00:02:47, Serial1/1
     24.0.0.0/24 is subnetted, 1 subnets
C       24.24.24.0 is directly connected, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.12.12.0 [110/128] via 24.24.24.2, 00:02:47, Serial1/1
     13.0.0.0/24 is subnetted, 1 subnets
O IA    13.13.13.0 [110/128] via 34.34.34.3, 00:02:47, Serial1/0


これで、OSPF外部ルートが消えました。
このままでは外部ルートへ到達できませんので、条件2も含めまして
R3へのデフォルトルートを設定してやります。

R3
router ospf 1
area 234 nssa default information-originate


R4#sh ip route
Gateway of last resort is 34.34.34.3 to network 0.0.0.0

     34.0.0.0/24 is subnetted, 1 subnets
C       34.34.34.0 is directly connected, Serial1/0
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.23.23.0 [110/65] via 34.34.34.3, 00:07:17, Serial1/0
                   [110/65] via 24.24.24.2, 00:07:17, Serial1/1
     24.0.0.0/24 is subnetted, 1 subnets
C       24.24.24.0 is directly connected, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.12.12.0 [110/128] via 24.24.24.2, 00:07:17, Serial1/1
     13.0.0.0/24 is subnetted, 1 subnets
O IA    13.13.13.0 [110/128] via 34.34.34.3, 00:07:17, Serial1/0
O*N2 0.0.0.0/0 [110/1] via 34.34.34.3, 00:00:03, Serial1/0


これでデフォルトルートが R3 へ向きました。
ただこれだと R3 の s1/0 が死んだときに外部にでれなくなりますね。

そうしたら R2 からも metric をあげて同じくデフォルトルートを広報
してやれば冗長化になるのではと下記設定追加してみました。

R2
router ospf 1
area 234 nssa default information-orignate metric 100


それで R3 の s1/0 を殺してみると、、、


R4#sh ip route
Gateway of last resort is 24.24.24.2 to network 0.0.0.0

     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.23.23.0 [110/65] via 24.24.24.2, 00:00:26, Serial1/1
     24.0.0.0/24 is subnetted, 1 subnets
C       24.24.24.0 is directly connected, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
O IA    12.12.12.0 [110/128] via 24.24.24.2, 00:00:26, Serial1/1
     13.0.0.0/24 is subnetted, 1 subnets
O IA    13.13.13.0 [110/129] via 24.24.24.2, 00:00:26, Serial1/1
O*N2 0.0.0.0/0 [110/100] via 24.24.24.2, 00:00:05, Serial1/1


metric 100 で デフォルトルートが R2 向けになりました。



まぁあれですね。
nssa のルータが一つしかないのであれば、R4でスタティック設定でもいいですよね。

ip route 0.0.0.0 0.0.0.0 34.34.34.3
ip route 0.0.0.0 0.0.0.0 24.24.24.2 200

みたいなかんじで。


更新日:2012年9月1日
TOPに戻る