OSPF エリア間経路フィルタリング(filter-list)





条件
・area 0 に 30.30.30.30/32 が広報されないようにしてください。
・設定はR2 にて行ってください。




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

R1
interface Serial1/0
ip add 12.12.12.1 255.255.255.0
no shut

router ospf 1
net 12.12.12.0 0.0.0.255 area 0

R2
interface Serial1/0
ip add 12.12.12.2 255.255.255.0
no shut

interface Serial1/1
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 23

R3
interface Serial1/1
ip add 23.23.23.3 255.255.255.0
no shut

interface lo0
ip add 30.30.30.30 255.255.255.255

interface lo1
ip add 31.31.31.31 255.255.255.255

router ospf 1
net 23.23.23.0 0.0.0.255 area 23
net 30.30.30.30 0.0.0.0 area 23
net 31.31.31.31 0.0.0.0 area 23




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


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

     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.23.23.0 [110/128] via 12.12.12.2, 00:21:54, Serial1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Serial1/0
     31.0.0.0/32 is subnetted, 1 subnets
O IA    31.31.31.31 [110/129] via 12.12.12.2, 00:20:22, Serial1/0
     30.0.0.0/32 is subnetted, 1 subnets
O IA    30.30.30.30 [110/129] via 12.12.12.2, 00:20:51, Serial1/0


この状態で area 0 に 30.30.30.30/32 が広報されないようにするには filter-list を使用します。
R2
ip prefix-list REDIST seq 5 deny 30.30.30.30/32
ip prefix-list REDIST seq 10 permit 0.0.0.0/0 le 32

router ospf 1
area 0 filter-list prefix REDIST in

これで、フィルタすることができました。

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

     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.23.23.0 [110/128] via 12.12.12.2, 00:21:56, Serial1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Serial1/0
     31.0.0.0/32 is subnetted, 1 subnets
O IA    31.31.31.31 [110/129] via 12.12.12.2, 00:20:24, Serial1/0


フィルタの適用有無は sh ip ospf のエリア情報で確認できます。


R2#sh ip ospf
 External flood list length 0
    Area BACKBONE(0)
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm last executed 00:27:42.252 ago
        SPF algorithm executed 2 times
        Area ranges are
        Area-filter REDIST in
        Number of LSA 4. Checksum Sum 0x01997A
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0



上記では in のオプションで適用しましたが、out オプションで適用することはできるか確認します。
out オプションで今回の条件をクリアするには、

R2
ip prefix-list REDIST seq 5 deny 30.30.30.30/32
ip prefix-list REDIST seq 10 permit 0.0.0.0/0 le 32

router ospf 1
area 23 filter-list prefix REDIST out

って感じですね。

特定のエリアから外へ対照のアドレスをフィルタしたい場合は、out。
特定のエリアの中へ対照のアドレスをフィルタしたい場合は、in。ですか。
わかりやすい。。



prefix-list の意味は下記がわかりやすいかな。
http://www.n-study.com/network/2009/09/post_124.html

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