OSPF static redistribute

構成

staticをOSPFに再配布

IF設定

■R1

R1(config)#int g1/0
R1(config-if)#ip add 172.16.1.1 255.255.255.252
R1(config-if)#no sh

R1(config-if)#int lo1
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#ospf network point-to-point

■R2

R2(config)#int g1/0
R2(config-if)#ip add 172.16.1.2 255.255.255.252
R2(config-if)#no sh

R2(config)#int g2/0
R2(config-if)#ip add 172.16.1.5 255.255.255.252
R2(config-if)#no sh


R2(config)#int lo1
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#ospf network point-to-point

■R3

R3(config)#int g2/0
R3(config-if)#ip add 172.16.1.6 255.255.255.252
R3(config-if)#no sh

R3(config-if)#int lo1
R3(config-if)#ip add 192.168.4.1 255.255.255.0
R3(config-if)#ospf network point-to-point

ospf側 routing設定

■R1

R1(config)#router ospf 1
R1(config-router)#network 172.16.1.1 0.0.0.0 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0

■R2

R2(config)#router ospf 1
R2(config-router)#network 172.16.1.2 0.0.0.0 area 0
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0

static側 routing設定

■R2

R2(config)#ip route 192.168.4.0 255.255.255.0 172.16.1.6

■R3

R3(config)#ip route 172.16.1.0 255.255.255.252 172.16.1.5
R3(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.5
R3(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.5
R3(config)#ip route 192.168.3.0 255.255.255.0 172.16.1.5

redistribute設定

■R2

R2(config)#router ospf 1
R2(config-router)#redistribute connected subnets
→サブネット化している場合
R2(config-router)#redistribute static subnets

確認

■R1 再配布設定前

staticエリアへの経路がない

■R1 再配布設定後

staticエリアへの経路を外部ルートタイプ2で受信
シードメトリック20(デフォルト)

メモ

■確認コマンド
LSDB
sh ip ospf database

LSA type1
sh ip ospf database router

LSA type2
sh ip ospf database network

LSA type5
sh ip ospf database external