概要

簡単なネットワーク構成でLSAタイプ5のフィルタを行う設定例です。ディストリビュートリストとルートマップを利用したフィルタの設定を行います。

ネットワーク構成

次の図のネットワーク構成で、LSAタイプ5のフィルタを行います。

図 LSAタイプ5フィルタを設定するネットワーク構成
図 LSAタイプ5フィルタを設定するネットワーク構成

R1がEIGRPとOSPFの境界となるASBRです。R1でEIGRPのルート情報をOSPFに再配送します。再配送することによって、R1はLSAタイプ5を生成します。このLSAタイプ5を生成するタイミングでのフィルタの設定を行っていきます。

以下、各ルータの設定の初期設定の抜粋です。

R1 初期設定抜粋

hostname R1
!
interface Serial1/0
 ip address 10.1.12.1 255.255.255.0
 clock rate 64000
 no dce-terminal-timing-enable
!
interface Serial1/1
 ip address 10.1.13.1 255.255.255.0
 clock rate 64000
 no dce-terminal-timing-enable
!
router eigrp 1
 network 10.1.13.0 0.0.0.255
 no auto-summary
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 redistribute eigrp 1 subnets
 network 10.1.12.0 0.0.0.255 area 0

R2 初期設定抜粋

hostname R2
!
interface Loopback0
 ip address 172.16.1.2 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback1
 ip address 172.16.2.2 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback2
 ip address 172.16.3.2 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 network 10.1.12.0 0.0.0.255 area 0
 network 172.16.0.0 0.0.255.255 area 0

R3 初期設定抜粋

!
interface Loopback0
 ip address 192.168.1.3 255.255.255.0
 no ip directed-broadcast
!
interface Loopback1
 ip address 192.168.2.3 255.255.255.0
 no ip directed-broadcast
!
interface Loopback2
 ip address 192.168.3.3 255.255.255.0
 no ip directed-broadcast
!
interface Serial0/0
 ip address 10.1.13.3 255.255.255.0
 no ip directed-broadcast
 no ip mroute-cache
 no fair-queue
!
router eigrp 1
 network 10.0.0.0
 network 192.168.0.0 0.0.255.255
 no auto-summary

そして、R1でEIGRPトポロジテーブルとOSPFのLSDBを確認すると、次のようになります。

R1 EIGRPトポロジテーブルとLSDBサマリー

R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(10.1.13.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.1.13.0/24, 1 successors, FD is 20512000
        via Connected, Serial1/1
P 192.168.1.0/24, 1 successors, FD is 20640000
        via 10.1.13.3 (20640000/128256), Serial1/1
P 192.168.2.0/24, 1 successors, FD is 20640000
        via 10.1.13.3 (20640000/128256), Serial1/1
P 192.168.3.0/24, 1 successors, FD is 20640000
        via 10.1.13.3 (20640000/128256), Serial1/1
R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         599         0x80000003 0x00269B 2
2.2.2.2         2.2.2.2         599         0x80000003 0x00DA14 5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.1.13.0       1.1.1.1         709         0x80000001 0x00ABD8 0
192.168.1.0     1.1.1.1         709         0x80000001 0x000D25 0
192.168.2.0     1.1.1.1         709         0x80000001 0x00022F 0
192.168.3.0     1.1.1.1         709         0x80000001 0x00F639 0

R1でEIGRPトポロジテーブル上のルート情報がOSPFのLSAタイプ5として生成されていることがわかります。R1でのLSAタイプ5生成の様子を図にすると、次のようになります。

図 R1でのLSAタイプ5の生成
図 R1でのLSAタイプ5の生成

distribute-listコマンドによるLSAタイプ5のフィルタ

distribute-list(標準ACL)での設定

R1でEIGRPからOSPFに再配送することでLSAタイプ5が生成されます。その際に、次のLSAタイプ5を生成しないフィルタをdistribute-listコマンドによって設定します。

  • 192.168.3.0/24

R1の設定は以下のようになります。

R1 distribute-listによるLSAタイプ5のフィルタ

access-list 1 deny 192.168.3.0
access-list 1 permit any
!
router ospf 1
 distribute-list 1 out eigrp 1

設定後のR1のOSPF LSDBサマリーは次のようになります。

R1 distribute-list設定後のLSDBサマリー

R1#show ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         315         0x80000002 0x00289A 2
2.2.2.2         2.2.2.2         315         0x80000003 0x000EE0 5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.1.13.0       1.1.1.1         321         0x80000001 0x00ABD8 0
192.168.1.0     1.1.1.1         319         0x80000001 0x000D25 0
192.168.2.0     1.1.1.1         319         0x80000001 0x00022F 0

192.168.3.0/24についてのLSAタイプ5が生成されていないことがわかります。また、show ip protocolsコマンドは、次のように表示されます。

R1 show ip protocols

R1#show ip protocols
Routing Protocol is "eigrp 1"
~省略~

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
    Redistributed eigrp 1 filtered by 1
  Incoming update filter list for all interfaces is not set
  Router ID 1.1.1.1
  It is an autonomous system boundary router
  Redistributing External Routes from,
    eigrp 1, includes subnets in redistribution
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    10.1.12.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    2.2.2.2              110      00:12:16
  Distance: (default is 110)

EIGRPから再配送しているときに、LSAタイプ5がアクセスリスト1にしたがってフィルタされていることがわかります。

図 distribute-listによるLSAタイプ5のフィルタ
図 distribute-listによるLSAタイプ5のフィルタ

distribute-list(プレフィクスリスト)での設定

ここまでの設定では、ルートを特定するために標準アクセスリストを利用していますが、プレフィクスリストを利用した次のような設定もできます。

R1 distribute-listによるLSAタイプ5のフィルタ(プレフィクスリスト)

ip prefix-list AAA deny 192.168.3.0/24
ip prefix-list AAA permit 0.0.0.0/0 le 32
!
router ospf 1
 no distribute-list 1 out eigrp 1
 distribute-list prefix AAA out eigrp 1

この場合、show ip protocolsは次のように表示されます。

R1 show ip protocols (プレフィクスリスト)

R1#sh ip protocols
~省略~

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
    Redistributed eigrp 1 filtered by (prefix-list) AAA
  Incoming update filter list for all interfaces is not set
  Router ID 1.1.1.1
  It is an autonomous system boundary router
  Redistributing External Routes from,
    eigrp 1, includes subnets in redistribution
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    10.1.12.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    2.2.2.2              110      00:13:42
  Distance: (default is 110)

route-mapによるによるLSAタイプ5のフィルタ

再配送を行うためのredistributeコマンドのオプションでルートマップを適用して、LSAタイプ5のフィルタを行うこともできます。先ほどと同じようにR1で192.168.3.0/24のLSAタイプ5を生成しないようにします。R1での設定は次のようになります。

R1 ルートマップによるLSAタイプ5のフィルタ

access-list 2 permit 192.168.3.0
!
route-map AAA deny 10
 match ip address 2
route-map AAA permit 20
!
router ospf 1
 no distribute-list prefix AAA out eigrp 1
 redistribute eigrp 1 subnets route-map AAA

設定後のR1のLSDBサマリーは次のようになります。

R1 show ip ospf database

R1#sh ip ospf database

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         23          0x80000003 0x00269B 2
2.2.2.2         2.2.2.2         201         0x80000004 0x000CE1 5

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.1.13.0       1.1.1.1         4           0x80000001 0x00ABD8 0
192.168.1.0     1.1.1.1         4           0x80000001 0x000D25 0
192.168.2.0     1.1.1.1         4           0x80000001 0x00022F 0

ルートマップを利用すると、単純にフィルタするだけではなくプラスαの処理が可能です。たとえば、EIGRPから再配送してLSAタイプ5を生成するときに、タグを付けたり、メトリックタイプやメトリック値を変更できます。例として、次の条件に基づいた設定を行います。

  • 192.168.3.0/24のLSAタイプ5は生成しない
  • 10.1.13.0/24のLSAタイプ5 メトリックタイプ E1 メトリック 100 タグ100
  • それ以外のLSAタイプ5 タグ20

R1での設定は次のように行います。

R1 ルートマップによるLSAタイプ5のフィルタ その2

access-list 3 permit 10.1.13.0
!
route-map BBB deny 10
 match ip address 2
route-map BBB permit 20
 match ip address 3
 set metric-type type-1
 set metric 100
 set tag 100
route-map BBB permit 30
 set tag 20
!
router ospf 1
 redistribute eigrp 1 subnets route-map BBB

図 ルートマップによるLSAタイプ5のフィルタ
図 ルートマップによるLSAタイプ5のフィルタ
図中のOSPF LSDB内の()はルートマップ「BBB」のシーケンス番号を表しています。

メトリックタイプやメトリック値は、LSDBサマリーではわかりません。LSAタイプ5の詳細を確認するためにR1でshow ip ospf database externalを見ます。

R1 show ip ospf database external

R1#show ip ospf database external

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Type-5 AS External Link States

  LS age: 98
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 10.1.13.0 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000002
  Checksum: 0xDBF2
  Length: 36
  Network Mask: /24
        Metric Type: 1 (Comparable directly to link state metric)
        TOS: 0
        Metric: 100
        Forward Address: 0.0.0.0
        External Route Tag: 100

  LS age: 85
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 192.168.1.0 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0x76A7
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 20

  LS age: 87
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 192.168.2.0 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0x6BB1
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 20

先ほどあげた条件のようにLSAタイプ5のメトリックタイプ、メトリック値、ルートタグが設定されていることがわかります。

OSPFの仕組み