auto-cost reference-bandwidth LSAタイマー変更 再配送



条件
・OSPFが以下のようなメトリック計算をするように設定してください。
 10,000Mbps→Cost 2
 10Mbps→Cost 2000
 1.544Mbps→12953
 0.768Mbps→26043
・R5でOSPF LSAのグループ化、チェックサム処理、MAX AGEをデフォルトの6倍以上の値になるよう設定してください。
・ネットワークが不安定になった際に同じLSAのフラッディングからR5を保護する為に、OSPFピアからの同一LSAの受取をデフォルト間隔の2倍に設定してください。
・全てのネットワークでの全ての接続性を確立する為、必要な再配送の設定をしてください。
・R5はBB1が周知する経路をR1経由で学習するようにしてください。
・R5はBB3が周知する経路をR2経由で学習するようにしてください。
・R5はBB2からの経路はBGPではなくRIPで学習するようにしてください。

一番上の問題からですが、OSPF 基本の基本で検証済みなので検証は省略しましょ。
コストの計算式はデフォルトで 100M / インターフェースの帯域 なので、10,000Mbps→Cost 2 とするには、
100M のところを、20000 にすれば、

20000 / 10000 = 2

となりますね。つづきましても、

20000 / 10Mbps = 2000
20000 / 1.544Mbps = 12953
20000 / 0.768Mbps = 26043

というかんじですね。従いましてすべてのルータで、

router ospf 1
auto-cost reference-bandwidth 20000

でオッケーですね。

次の問題はちょっと時間をかけたいところです。。
・R5でOSPF LSAのグループ化、チェックサム処理、MAX AGEをデフォルトの6倍以上の値になるよう設定してください。

とりあえず、答えは下記の一行です。デフォルトは240秒なので6倍となると、40秒ですね。

timers pacing lsa-group 40

ほかにはどんなタイマーがあるのかというと、下記の3つ。
sh ip ospf で下記のようにみれますね。

R1(config-router)#timers pacing ?
  flood           OSPF flood pacing timer
  lsa-group       OSPF LSA group pacing timer
  retransmission  OSPF retransmission pacing timer

R1#sh ip ospf
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
それぞれのタイマーの意味としは、
LSA group pacing timer
 →LSAのグループ化, checksum, refreshを行う間隔
Interface flood pacing timer
 →LSAを定期送信する間隔
Retransmission pacing timer
 →LSAに対する応答がない場合の再送待ち時間

んー設定の変更を目で確認するために構成を作ってみたけど、debug でLSAの定期送信が見えないなあ。
33msecって相当間隔せまいけどどゆことでしょ。

いいか、とりあえずこうゆうのがあるってことは覚えた。
完ぺき主義はながつづきしないよね。

つぎもタイマー系。
・ネットワークが不安定になった際に同じLSAのフラッディングからR5を保護する為に、OSPFピアからの同一LSAの受取をデフォルト間隔の2倍に設定してください。

これもとりあえず答え。
timers lsa arrival 2000

デフォルトが 1000 msec なので2倍の2000msecですな。

これも show ip ospf でみれます。下記だと一番下ね。

R1#sh ip ospf
 Routing Process "ospf 1" with ID 1.1.1.1
 Start time: 00:05:13.528, Time elapsed: 00:48:42.060
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Supports area transit capability
 Router is not originating router-LSAs with maximum metric
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Incremental-SPF disabled
 Minimum LSA interval 5 secs
 Minimum LSA arrival 1000 msecs
参考 http://www.cisco.com/en/US/docs/ios/12_3t/ip_route/command/reference/ip2_t1gt.html#wp1118217

次の問題は、
・全てのネットワークでの全ての接続性を確立する為、必要な再配送の設定をしてください。

この一文は下の問題のことをしめすようなので、一旦無視。で次の2行。

・R5はBB1が周知する経路をR1経由で学習するようにしてください。
・R5はBB3が周知する経路をR2経由で学習するようにしてください。

この問題は下記の構成で代用します。問題は下記に置き換え。
・R4はR1のLo0への経路をR2経由で学習するように。
・R4はR1のLo1への経路をR3経由で学習するように。


下記の状態からスタート。

R1
interface Loopback0
 ip address 10.0.0.1 255.255.255.255
!
interface Loopback1
 ip address 20.0.0.1 255.255.255.255
!
interface Serial1/0
 ip address 1.1.1.1 255.255.255.0
!
interface Serial1/1
 ip address 2.2.2.1 255.255.255.0
!
router eigrp 100
redistribute connected
network 1.1.1.1 0.0.0.0
network 2.2.2.1 0.0.0.0
no auto-summary

R2
interface Serial1/0
 ip address 1.1.1.2 255.255.255.0
interface Serial1/1
 ip address 3.3.3.2 255.255.255.0
!
router eigrp 100
redistribute ospf 1 metric 10000 1 255 255 1500
network 1.1.1.2 0.0.0.0
no auto-summary
!
router ospf 1
redistribute eigrp 100 subnets
network 3.3.3.2 0.0.0.0 area 0

R3
interface Serial1/0
 ip address 4.4.4.3 255.255.255.0
interface Serial1/1
 ip address 2.2.2.3 255.255.255.0
!
router eigrp 100
redistribute ospf 1 metric 10000 1 255 255 1500
network 2.2.2.3 0.0.0.0
no auto-summary
!
router ospf 1
redistribute eigrp 100 subnets
network 4.4.4.3 0.0.0.0 area 0

R4
interface Serial1/0
 ip address 4.4.4.4 255.255.255.0
!
interface Serial1/1
 ip address 3.3.3.4 255.255.255.0
!
router ospf 1
 network 3.3.3.4 0.0.0.0 area 0
 network 4.4.4.4 0.0.0.0 area 0

まずはこの構成でR4でルーティングを見るとLo0,Lo1 ともS1/1で通信することがわかります。

R4
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/20] via 4.4.4.3, 00:00:00, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
O E2    2.2.2.0 [110/20] via 4.4.4.3, 00:00:00, Serial1/0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Serial1/1
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Serial1/0
     20.0.0.0/32 is subnetted, 1 subnets
O E2    20.0.0.1 [110/20] via 3.3.3.2, 00:00:00, Serial1/1
     10.0.0.0/32 is subnetted, 1 subnets
O E2    10.0.0.1 [110/20] via 3.3.3.2, 00:00:00, Serial1/1

どちらの経路ともコストが同じなので、ロードバランスするかなと思いましたが、なぜだか
しませんね。。clear ip ospf process を何回かすると一瞬ロードバランスするときもある。。
まぁ、今回はとりあえず、保留。
ちなみにR2を通るか、R3を通るかの選択としては、R2,R3でredistributeするときに、
metricを指定してやれば、優先度を変えれますね。
O E2 だとデフォルトでmetric20 なので、

R3
router ospf 1
redistribute eigro 100 subnets metric 10

とかやってやれば、R3経由のメトリックが優先されてR3経由になります。と。

で、Lo0の経路とLo1の経路を分けてやるには、、tag を使うらしい。



上記コンフィグに下記追加します。

R1
!
router eigrp 100
redistribute connected route-map CONN2EIGRP

ip prefix-list FROM_Lo0 seq 5 permit 10.0.0.1/32
!
ip prefix-list FROM_Lo1 seq 5 permit 20.0.0.1/32
!
route-map CONN2EIGRP permit 10
 match ip address prefix-list FROM_Lo0
 set tag 1
!
route-map CONN2EIGRP permit 20
 match ip address prefix-list FROM_Lo1
 set tag 2
!
route-map CONN2EIGRP permit 30

R2
router ospf 1
redistribute eigrp 100 subnets route-map EIGRP2OSPF

route-map EIGRP2OSPF permit 10
match tag 1
set metric 1

route-map EIGRP2OSPF permit 20

R3
router ospf 1
redistribute eigrp 100 subnets route-map EIGRP2OSPF

route-map EIGRP2OSPF permit 10
match tag 2
set metric 1

route-map EIGRP2OSPF permit 20

R4
router ospf 1
 network 3.3.3.4 0.0.0.0 area 0
 network 4.4.4.4 0.0.0.0 area 0

上記設定した段階で、R4 にて sh ip route を見ると、

R4
Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/10] via 3.3.3.2, 00:00:02, Serial1/1
     2.0.0.0/24 is subnetted, 1 subnets
O E2    2.2.2.0 [110/10] via 3.3.3.2, 00:00:01, Serial1/1
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Serial1/1
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Serial1/0
     20.0.0.0/32 is subnetted, 1 subnets
O E2    20.0.0.1 [110/1] via 4.4.4.3, 00:03:14, Serial1/0
     10.0.0.0/32 is subnetted, 1 subnets
O E2    10.0.0.1 [110/1] via 3.3.3.2, 00:03:41, Serial1/1

10.0.0.1 への経路がR2経由で、metric 1。
20.0.0.1 への経路がR3経由で、metric 1になっていることがわかりますね。

また、sh ip ospf database で、、、

R4#sh ip ospf data

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

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
3.3.3.2         3.3.3.2         1440        0x8000000F 0x002139 2
4.4.4.3         4.4.4.3         1195        0x80000007 0x0053FF 2
4.4.4.4         4.4.4.4         1358        0x80000015 0x002DEC 4

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.0         3.3.3.2         274         0x80000001 0x000B91 0
1.1.1.0         4.4.4.3         251         0x80000001 0x00513D 0
2.2.2.0         3.3.3.2         274         0x80000001 0x00E6B2 0
2.2.2.0         4.4.4.3         251         0x80000001 0x002D5E 0
10.0.0.1        3.3.3.2         470         0x8000003F 0x00DD80 1
20.0.0.1        4.4.4.3         444         0x80000045 0x004306 2

それぞれのルートにtag がついていることがわかりますね。

ちなみに OSPF process では redistribute の tag-value でもtagの値を変えることができます。

router ospf 1
redistribute eigrp 100 tag 8

みたいな感じで、route-map を使わなくても変えることができます。
んー、いろいろ方法ありすぎっしょ。

次の問題にいく前にさっきのはEIGRPからOSPFでの実験でしたが、今度はOSPFからEIGRPでもtagによる制御ができるのか
を試してみたいと思います。


今回はちょっと段階的に設定してみます。

R4
interface lo0
ip add 30.0.0.4 255.255.255.255
interface lo1
ip add 40.0.0.4 255.255.255.255
!
router ospf 1
redistribute connected route-map CONN2OSPF subnets

ip prefix-list FROM_Lo0 seq 5 permit 30.0.0.4/32
!
ip prefix-list FROM_Lo1 seq 5 permit 40.0.0.4/32
!
route-map CONN2OSPF permit 10
 match ip address prefix-list FROM_Lo0
 set tag 1
!
route-map CONN2OSPF permit 20
 match ip address prefix-list FROM_Lo1
 set tag 2
!
route-map CONN2OSPF permit 30

この時点で、R1でルーティングをみてみますと、、


     40.0.0.0/32 is subnetted, 1 subnets
D EX    40.0.0.4 [170/2170112] via 2.2.2.3, 00:00:06, Serial1/1
                 [170/2170112] via 1.1.1.2, 00:00:06, Serial1/0
     10.0.0.0/32 is subnetted, 1 subnets
C       10.0.0.1 is directly connected, Loopback0
     30.0.0.0/32 is subnetted, 1 subnets
D EX    30.0.0.4 [170/2170112] via 2.2.2.3, 00:00:06, Serial1/1
                 [170/2170112] via 1.1.1.2, 00:00:06, Serial1/0

いいかんじでロードバランスしてることがわかります。
あと sh ip eigrp top をみると、、


P 30.0.0.4/32, 2 successors, FD is 2170112, tag is 3
        via 1.1.1.2 (2170112/256256), Serial1/0
        via 2.2.2.3 (2170112/256256), Serial1/1
P 40.0.0.4/32, 2 successors, FD is 2170112, tag is 4
        via 1.1.1.2 (2170112/256256), Serial1/0
        via 2.2.2.3 (2170112/256256), Serial1/1

ちゃんとタグがついてることもわかっちゃうじゃないですかー。

で、R2,R3にてtagによる経路制御をいれていきます。

R2
router eigrp 100
redistribute ospf 1 metric 10000 1 255 1 1500 route-map OSPF2EIGRP

route-map OSPF2EIGRP permit 10
match tag 3
set metric -5000

route-map OSPF2EIGRP permit 20

R3
router eigrp 100
redistribute ospf 1 metric 10000 1 255 1 1500 route-map OSPF2EIGRP

route-map OSPF2EIGRP permit 10
match tag 4
set metric -5000

route-map OSPF2EIGRP permit 20

んーっと、これで同じような設定にしたと思うのですけど、、経路制御できないなぁ。。
ちゃんとtagをつけることはできてるのに、ロードバランスしたままになってる。。


R1
#show ip route
     40.0.0.0/32 is subnetted, 1 subnets
D EX    40.0.0.4 [170/768256] via 2.2.2.3, 00:00:36, Serial1/1
                 [170/768256] via 1.1.1.2, 00:00:36, Serial1/0
     10.0.0.0/32 is subnetted, 1 subnets
C       10.0.0.1 is directly connected, Loopback0
     30.0.0.0/32 is subnetted, 1 subnets
D EX    30.0.0.4 [170/768256] via 2.2.2.3, 00:00:36, Serial1/1
                 [170/768256] via 1.1.1.2, 00:00:36, Serial1/0

R1
#sh ip eigrp top
P 30.0.0.4/32, 2 successors, FD is 768256, tag is 1
        via 1.1.1.2 (768256/256256), Serial1/0
        via 2.2.2.3 (768256/256256), Serial1/1
P 40.0.0.4/32, 2 successors, FD is 768256, tag is 2
        via 1.1.1.2 (768256/256256), Serial1/0
        via 2.2.2.3 (768256/256256), Serial1/1

なんでだろうなぁ。なんかメトリックの制御ができてない気がするなぁ。。
ちょっとEIGRPはいちから勉強しなかあかんので、ここは保留で。。

今回のようにルーティングプロトコル間に2台のルータある場合再配送時に
ベスト経路にならない場合があるので、下記で確認しましょう。
http://memorials.blog83.fc2.com/blog-entry-41.html

更新日:2012年8月4日