この部分の広告を募集しています。 詳しくはこちら

2009年8月アーカイブの最新記事

OSPFのルートフィルタ その14 For CCIE R&S ラボ試験

(所属カテゴリー:IPルーティング | シスコ---投稿日時:2009年8月26日)

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

R1でEIGRPからOSPFに再配送することで生成するLSAタイプ5のうち、

  • 192.168.3.0/24

についてのLSAタイプ5を生成しないフィルタをdistribute-listコマンドによ って設定します。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から再配送しているときに、アクセスリスト1にしたがってフィルタしていることがわかります。

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

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

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 2 permit 192.168.3.0
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
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ospf_filter18.jpg
図 ルートマップによるLSAタイプ5のフィルタ

メトリックタイプやメトリック値は、LSDBサマリーではわかりません。そのため、LSAタイプの詳細を確認するために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のメトリックタイプ、メトリック値、ルートタグが設定されていることがわかります。

Google
Web n-study.com

各コンテンツの最新記事

有料コンテンツライブラリ(ITエンジニア教育資料)

ネットワーク技術雑誌レビュー

ベンダ資格受験記

オススメ!ネットワーク技術雑誌・書籍

MindMapでおべんきょ

結果を出せるコーチング

Geneのつぶやき

The Power of Words

スポンサードリンク

スポンサードリンク