その1 EIGRP にて送信元ルータにて経路選択設定(distance,offset-list)






条件
・R1 から R4 のloopback0,1,2 への経路はR2経由としてください。
・offset-list prefix-list は使用しないでください。


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


R1
interface s1/0
ip address 12.12.12.1 255.255.255.0
no shut

interface s1/1
ip address 13.13.13.1 255.255.255.0
no shut

router eigrp 100
net 12.12.12.0 0.0.0.255
net 13.13.13.0 0.0.0.255
no auto-summary

R2
interface s1/0
ip address 12.12.12.2 255.255.255.0
no shut

interface s1/1
ip address 24.24.24.2 255.255.255.0
no shut

router eigrp 100
net 12.12.12.0 0.0.0.255
net 24.24.24.0 0.0.0.255
no auto-summary

R3
interface s1/0
ip address 34.34.34.3 255.255.255.0
no shut

interface s1/1
ip address 13.13.13.3 255.255.255.0
no shut

router eigrp 100
net 34.34.34.0 0.0.0.255
net 13.13.13.0 0.0.0.255
no auto-summary

R4
interface s1/0
ip address 34.34.34.4 255.255.255.0
no shut

interface s1/1
ip address 24.24.24.4 255.255.255.0
no shut

interface lo0
ip add 4.40.40.40 255.255.255.0

interface lo1
ip add 4.41.41.41 255.255.255.0

interface lo2
ip add 4.42.42.42 255.255.255.0

router eigrp 100
net 34.34.34.0 0.0.0.255
net 24.24.24.0 0.0.0.255
net 4.0.0.0 0.255.255.255
no auto-summary




まず上記状態にて R1 にて sh ip route を打つと、、


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

     34.0.0.0/24 is subnetted, 1 subnets
D       34.34.34.0 [90/2681856] via 13.13.13.3, 00:02:24, Serial1/1
     4.0.0.0/24 is subnetted, 3 subnets
D       4.42.42.0 [90/2809856] via 13.13.13.3, 00:00:09, Serial1/1
                  [90/2809856] via 12.12.12.2, 00:00:09, Serial1/0
D       4.41.41.0 [90/2809856] via 13.13.13.3, 00:00:09, Serial1/1
                  [90/2809856] via 12.12.12.2, 00:00:09, Serial1/0
D       4.40.40.0 [90/2809856] via 13.13.13.3, 00:00:09, Serial1/1
                  [90/2809856] via 12.12.12.2, 00:00:09, Serial1/0
     24.0.0.0/24 is subnetted, 1 subnets
D       24.24.24.0 [90/2681856] via 12.12.12.2, 00:02:24, Serial1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Serial1/0
     13.0.0.0/24 is subnetted, 1 subnets
C       13.13.13.0 is directly connected, Serial1/1


R1からR4 のLo0.1.2 への経路は双方からロードバランスされていることがわかります。
これをR2経由のみの経路とするには、、いろいろ方法がありますが、まずは R1のみにて設定
するには、R2からきた経路情報のAD値をあげてやるという方法がありますね。

distance [AD値] [経路を配信する直近のルータアドレス] [ワイルドカード] [ACL(対象経路を指定)]

参考:
http://www.infraexpert.com/study/rp7distance.htm

R1
access-list 1 permit 4.42.42.0 0.0.0.255
access-list 1 permit 4.41.41.0 0.0.0.255
access-list 1 permit 4.40.40.0 0.0.0.255

router eig 100
distance 91 13.13.13.0 0.0.0.255 1

直近のルータアドレスとしては、R3 の 13.13.13.3 を指定すればオッケーと思いますが、
上記では第4オクテットはなんでもオケーにしています。
AD値をデフォルトより 1 増やし、対象経路は、R4 の Lo0,1,2が含まれるようにしています。

R3 側からの経路を AD;91 とすることで、R2 経由の経路は AD:90 のままのためこちらが優先される
ものとなります。



上記設定し、再度 sh ip route を見ると、


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

     34.0.0.0/24 is subnetted, 1 subnets
D       34.34.34.0 [90/3193856] via 12.12.12.2, 00:00:00, Serial1/0
     4.0.0.0/24 is subnetted, 3 subnets
D       4.42.42.0 [90/2809856] via 12.12.12.2, 00:00:00, Serial1/0
D       4.41.41.0 [90/2809856] via 12.12.12.2, 00:00:00, Serial1/0
D       4.40.40.0 [90/2809856] via 12.12.12.2, 00:00:00, Serial1/0
     24.0.0.0/24 is subnetted, 1 subnets
D       24.24.24.0 [90/2681856] via 12.12.12.2, 00:00:00, Serial1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Serial1/0
     13.0.0.0/24 is subnetted, 1 subnets
C       13.13.13.0 is directly connected, Serial1/1


ロードバランスされなくなり、R2経由のみとなりました。


はい。うまくいったので、次は条件で禁断となっている offset-list での設定
を確認してみます。

offset-list [ACL(対象NW)] in|out [加算されるmetric] インターフェース

参考:
http://www.netagency.biz/ccie/modules/xhnewbb/viewtopic.php?topic_id=45

R1
access-list 1 permit 4.42.42.0 0.0.0.255
access-list 1 permit 4.41.41.0 0.0.0.255
access-list 1 permit 4.40.40.0 0.0.0.255

router eig 100
offset-list 1 in 3000000 s1/1

offset-list とは 経路情報の受信時、もしくは送信時にメトリックを加算するもの。
今回はs1/0 からの受信時(in)、3000000 をメトリックに加算している。



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

     34.0.0.0/24 is subnetted, 1 subnets
D       34.34.34.0 [90/2681856] via 13.13.13.3, 00:38:06, Serial1/1
     4.0.0.0/24 is subnetted, 3 subnets
D       4.42.42.0 [90/2809856] via 12.12.12.2, 00:00:03, Serial1/0
D       4.41.41.0 [90/2809856] via 12.12.12.2, 00:00:03, Serial1/0
D       4.40.40.0 [90/2809856] via 12.12.12.2, 00:00:03, Serial1/0
     24.0.0.0/24 is subnetted, 1 subnets
D       24.24.24.0 [90/2681856] via 12.12.12.2, 00:38:06, Serial1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Serial1/0
     13.0.0.0/24 is subnetted, 1 subnets
C       13.13.13.0 is directly connected, Serial1/1


s1/1 からの経路がなくなり R2 経由のみとなりました。
s1/1 からの経路がどのようになっているか sh ip eigrp top all を見てみましょう。


R1#sh ip eig top all
IP-EIGRP Topology Table for AS(100)/ID(13.13.13.1)

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

P 4.42.42.0/24, 1 successors, FD is 2809856, serno 165
        via 12.12.12.2 (2809856/2297856), Serial1/0
        via 13.13.13.3 (5809856/5297856), Serial1/1
P 4.41.41.0/24, 1 successors, FD is 2809856, serno 164
        via 12.12.12.2 (2809856/2297856), Serial1/0
        via 13.13.13.3 (5809856/5297856), Serial1/1
P 4.40.40.0/24, 1 successors, FD is 2809856, serno 163
        via 12.12.12.2 (2809856/2297856), Serial1/0
        via 13.13.13.3 (5809856/5297856), Serial1/1


それぞれ、2809856 + 3000000 で、5809856 がメトリックになっていることがわかりますね。


はい。もうちょっと掘り下げて、、R4側で制御したい場合はどうするかということで
R4 にて offset-list をあててみました。

R4
router eigrp 100
offset-list 1 out 3000 s1/0

これで、R1からR3経由の経路は metric が 3000 増えるはずです。


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

     34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       34.34.34.0/24 [90/3193856] via 12.12.12.2, 00:09:38, Serial1/0
D       34.0.0.0/8 [90/2681856] via 13.13.13.3, 00:09:28, Serial1/1
     4.0.0.0/24 is subnetted, 3 subnets
D       4.42.42.0 [90/2809856] via 12.12.12.2, 00:05:32, Serial1/0
D       4.41.41.0 [90/2809856] via 12.12.12.2, 00:05:32, Serial1/0
D       4.40.40.0 [90/2809856] via 12.12.12.2, 00:05:32, Serial1/0
     24.0.0.0/24 is subnetted, 1 subnets
D       24.24.24.0 [90/2681856] via 12.12.12.2, 00:09:27, Serial1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, Serial1/0
     13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       13.13.13.0/24 is directly connected, Serial1/1



R1#sh ip eig top
IP-EIGRP Topology Table for AS(100)/ID(13.13.13.1)

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

P 4.42.42.0/24, 1 successors, FD is 2809856, serno 36
        via 12.12.12.2 (2809856/2297856), Serial1/0
        via 13.13.13.3 (2839856/2327856), Serial1/1
P 4.41.41.0/24, 1 successors, FD is 2809856, serno 35
        via 12.12.12.2 (2809856/2297856), Serial1/0
        via 13.13.13.3 (2839856/2327856), Serial1/1
P 4.40.40.0/24, 1 successors, FD is 2809856, serno 34
        via 12.12.12.2 (2809856/2297856), Serial1/0
        via 13.13.13.3 (2839856/2327856), Serial1/1
P 12.12.12.0/24, 1 successors, FD is 2169856, serno 5


それぞれの R3 を通るルートが R2 を通るルートよりも 3000 加算されていることが
わかりますね。また 3000だけ加算しているので、そのルートも フィージブルサクセサに
選出されており、sh ip eig top (allなし) でも見れます。

ちなみに offset-list 適用有無は sh ip protocol で見れます。

R4#sh ip protocols
Routing Protocol is "eigrp 100"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Outgoing routes in Serial1/0 will have 3000 added to metric if on list 1
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 100
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect


また、別の方法ですが、distribute-list で R3 経由のルート情報を拒否する方法もありますね。
ただこれだと R2 経由が死んだ場合 R3 が使われないことになります。
フロスタだな。フロスタフロスタ。

方法としては下記のとおり。

R1
access-list 1 permit 4.42.42.0 0.0.0.255
access-list 1 permit 4.41.41.0 0.0.0.255
access-list 1 permit 4.40.40.0 0.0.0.255
access-list 2 permit 13.13.13.3 0.0.0.0

route-map DIST deny 10
match ip add 1
match ip next-hop 2

route-map DIST permit 20

router eig 100
distribute-list route-map DIST in

lab20-2-6.html と同じ方法なので図は割愛します。

フロスタ入れるならこう。
ip route 4.42.42.0 255.255.255.0 13.13.13.3 240
ip route 4.41.41.0 255.255.255.0 13.13.13.3 240
ip route 4.40.40.0 255.255.255.0 13.13.13.3 240

更新日:2012年8月28日
TOPに戻る