はじめに
OSPF では、特定の LSA を計算に使用しないために distribute-list を使用することができますが、OSPF local RIB の実装前後でこの動作も変更されています。
- 実装前:ベストパスとなる LSA を除外した場合に、次に有効なパスを計算します
- 実装後:ベストパスとなる LSA を除外すると、次に有効なパスは計算されません
これは、distribute-list を使用するルータでベストではないパスを routing table に install した際、distribute-list を使用しないルータと計算結果が違うことにより routing loop が発生することがあったために変更されました。
この変更により、OSPF で distribute-list を使用している機器において IOS のバージョンを変更した際、期待どおりの経路計算が行われないことがございます。OSPF local RIB が実装されているバージョンについては Feature Navigator をご参照ください。
このドキュメントでは。実装変更前後で具体的にどのように動作が変わるか、簡単な構成を用い解説します。
構成
--+--(172.20.1.0/24)--+--
| |
E1/0 E1/0
R2 R3
E0/0 E0/0
| |
--+--(192.169.1.0/24)-+--
|
E0/0
R1
R2, R3 共に 172.20.1.0/24 を OSPF へ再配信。この時のパラメータは
R2 : metic 200, tag 200
R3 : metic 300, tag 300
とし、通常 R1 は R2 経由の External route で 172.20.1.0/24 を学習する状況です。
ここで、R1 は distribute-list に route-map を使用し、 tag 200 を持つ LSA を除外します。
Distribute-list 設定前の routing table 及び OSPF database の状況
172.20.0.0/24 is subnetted, 1 subnets
O E2 172.20.1.0 [110/200] via 192.168.1.2, 00:00:03, Ethernet0/0
10.0.0.0/32 is subnetted, 3 subnets
O 10.2.2.2 [110/11] via 192.168.1.2, 00:00:03, Ethernet0/0
O 10.3.3.3 [110/11] via 192.168.1.3, 00:00:03, Ethernet0/0
C 10.1.1.1 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Ethernet0/0
------------------------------------------------------------------------------------------------------------
R1#show ip ospf database
OSPF Router with ID (10.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.1.1.1 10.1.1.1 1335 0x80000005 0x00E92B 2
10.2.2.2 10.2.2.2 1329 0x80000004 0x00F019 2
10.3.3.3 10.3.3.3 1320 0x80000004 0x00EF10 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.1.3 10.3.3.3 1340 0x80000002 0x005B29
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.20.1.0 10.2.2.2 1329 0x80000001 0x00CF81 200
172.20.1.0 10.3.3.3 1320 0x80000001 0x00B3D1 300
機器設定
R1
interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
interface Ethernet0/0
ip address 192.168.1.1 255.255.255.0
!
router ospf 1
log-adjacency-changes
network 10.1.1.1 0.0.0.0 area 0
network 192.168.1.0 0.0.0.255 area 0
distribute-list route-map TEST in
!
route-map TEST deny 10
match tag 200
!
route-map TEST permit 20
!
R2
interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface Ethernet0/0
ip address 192.168.1.2 255.255.255.0
!
interface Ethernet1/0
ip address 172.20.1.2 255.255.255.0
!
router ospf 1
log-adjacency-changes
redistribute connected metric 200 subnets tag 200
network 10.2.2.2 0.0.0.0 area 0
network 192.168.1.0 0.0.0.255 area 0
R3
interface Loopback0
ip address 10.3.3.3 255.255.255.255
!
interface Ethernet0/0
ip address 192.168.1.3 255.255.255.0
!
interface Ethernet1/0
ip address 172.20.1.3 255.255.255.0
!
router ospf 1
log-adjacency-changes
redistribute connected metric 300 subnets tag 300
network 10.3.3.3 0.0.0.0 area 0
network 192.168.1.0 0.0.0.255 area 0
OSPF local RIB 実装変更以前
ベストパスの次に有効となる経路、この場合 R3 経由の経路が計算され、routing table へ install されます。
(OSPF local RIB が実装されていない 12.4(25) での例)
172.20.0.0/24 is subnetted, 1 subnets
O E2 172.20.1.0 [110/300] via 192.168.1.3, 00:02:59, Ethernet0/0
10.0.0.0/32 is subnetted, 3 subnets
O 10.2.2.2 [110/11] via 192.168.1.2, 00:02:59, Ethernet0/0
O 10.3.3.3 [110/11] via 192.168.1.3, 00:02:59, Ethernet0/0
C 10.1.1.1 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Ethernet0/0
OSPF local RIB 実装変更以降
ベストパスとなる LSA が除外されてしまうと、次に有効となる経路があっても routing table へ install されません。
(OSPF local RIB が実装されている 15.1(4)M での例)
10.0.0.0/32 is subnetted, 3 subnets
C 10.1.1.1 is directly connected, Loopback0
O 10.2.2.2 [110/11] via 192.168.1.2, 00:00:48, Ethernet0/0
O 10.3.3.3 [110/11] via 192.168.1.3, 00:00:48, Ethernet0/0
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, Ethernet0/0
L 192.168.1.1/32 is directly connected, Ethernet0/0