メモのページ - チラシの裏メモ 3枚目

通信技術や気になった事を黙々とメモし続ける

EIGRPのDefault Route

まだまだ続くEIGRPネタ。
EIGRPにおけるDefault Route注入の目的は、ルーティングテーブルに載っていない宛先への到達性確保の為、他通信事業者の通信網と接続しているが相手側の設定内容を把握しきれていない為、想定していない宛先へ流れるユーザトラヒックをとりあえずネイバーへ渡す為など。
Default Route単体ではルーティングテーブルのサイズを縮小させず、Route Filtering等と併用させる事でルーティングテーブルのサイズの縮小が可能になる。


EIGRPで構成されるネットワークにてDefault Routeをアドバタイズする方法はいくつか有る。
Default Route(ip route 0.0.0.0 0.0.0.0 ...のやつ)を設定し、それをEIGRPネットワークに再配布(Redistribute)する方法。
もう1つはEIGRPの設定にてnetwork 0.0.0.0を追加する方法。
今回はこの2つでDefault Routeをアドバタイズさせた。
他に、ip summary-addressコマンドの使用や、ip default-network等の方法があるのだが、現在における主流の方法はip summary-addressの方かも。
IOSのバージョンや機種によって設定方法が微妙に異なるようだが、動作に関しては大昔の機種やとても古いIOSバージョン(11.xなど)でない限り、大きな違いというものは無いと思われる。



当方の環境
構成(クリックすると拡大表示)

MI-CAT3750-ME-SW-01:Catalyst3750Metro
MI-CAT3750-ME-SW-02:Catalyst3750Metro
MI-CAT3750-ME-SW-03:Catalyst3750Metro
MI-CAT3750-ME-SW-02側にてMI-CAT3750-ME-SW-03向けにDefault Routeをアドバタイズするよう設定。
MI-CAT3750-ME-SW-03側にて、Routing Tableに該当経路情報が載る様子を見てみた。
(Catalyst3750 Metro、IOS ver:12.2(58)EZ)



EIGRPネットワークに再配布する方法
1.まずは、Static Route+Redistributeの方法で。
MI-CAT3750-ME-SW-02からMI-CAT3750-ME-SW-03側に向けてDefault Routeを投げるStatic Routeの設定し、それをredistribute staticでEIGRPネットワークにアドバタイズさせる。
最初に、Default Routeの設定。
Next Hopとしては出口となるInterfaceを指定する。

MI-CAT3750-ME-SW-02#conf t
MI-CAT3750-ME-SW-02(config)#ip route 0.0.0.0 0.0.0.0 fastEthernet 1/0/2
MI-CAT3750-ME-SW-02(config)#end
MI-CAT3750-ME-SW-02#

次に、EIGRPの設定にてredistribute staticを追加。

MI-CAT3750-ME-SW-02#conf t
MI-CAT3750-ME-SW-02(config)#router eigrp 1
MI-CAT3750-ME-SW-02(config-router)#redistribute static metric 1000000 10 255 1 1500
MI-CAT3750-ME-SW-02(config-router)#exit
MI-CAT3750-ME-SW-02(config)#exit
MI-CAT3750-ME-SW-02#


....ちなみに、EIGRPのredistributeコマンドにおけるMetric値オプション(シードメトリック)は以下のとおり。

metric 1000000 10 255 1 1500の場合

1000000:Bandwidth(帯域幅) 単位はkbps
10:Delay(遅延) 単位は10ms
255:Reliability(信頼性) 255で100%となる
1:Load(負荷) 255で100%となる
1500:MTU Size
※ここで設定するBandwidthはEIGRPのメトリック値計算の為の値であって、Interfaceの「速度」を調整する為の値ではない。


上記設定後、MI-CAT3750-ME-SW-02側でルーティングテーブルを確認。
「S*  0.0.0.0/0 is directly connected, FastEthernet1/0/2」の行が載った。
ルーティングテーブルに載っていない経路向けのユーザトラヒックは、とりあえずFa1/0/2からMI-CAT3750-ME-SW-03の方向へ転送される。

MI-CAT3750-ME-SW-02#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
   D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
   N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
   E1 - OSPF external type 1, E2 - OSPF external type 2
   i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
   ia - IS-IS inter area, * - candidate default, U - per-user static route
   o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
   + - replicated route, % - next hop override

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

S*  0.0.0.0/0 is directly connected, FastEthernet1/0/2
   10.0.0.0/32 is subnetted, 3 subnets
D    10.1.1.1 [90/133120] via 192.168.100.1, 00:00:17, FastEthernet1/0/1
C    10.1.1.2 is directly connected, Loopback0
D    10.1.1.3 [90/133120] via 192.168.101.2, 00:00:10, FastEthernet1/0/2
   192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C    192.168.100.0/24 is directly connected, FastEthernet1/0/1
L    192.168.100.2/32 is directly connected, FastEthernet1/0/1
   192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C    192.168.101.0/24 is directly connected, FastEthernet1/0/2
L    192.168.101.1/32 is directly connected, FastEthernet1/0/2
MI-CAT3750-ME-SW-02#

この状態でshow ip eigrp topology 0.0.0.0コマンドを叩くと、出力内容一番下の[1]に出力されているとおりExterior Flagが0.0.0.0のエントリーに立っている事がわかる。
また、各Metric値は上記にてredistribute static設定の際に投入したシードメトリック値と同じである。

MI-CAT3750-ME-SW-02#sh ip eigrp topology 0.0.0.0
EIGRP-IPv4 Topology Entry for AS(1)/ID(10.1.1.2) for 0.0.0.0/0
 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 5120
 Descriptor Blocks:
 0.0.0.0, from Rstatic, Send flag is 0x0
   Composite metric is (5120/0), route is External
   Vector metric:
    Minimum bandwidth is 1000000 Kbit
    Total delay is 100 microseconds
    Reliability is 255/255
    Load is 1/255
    Minimum MTU is 1500
    Hop count is 0
    Originating router is 10.1.1.2
   External data:
    AS number of route is 0
    External protocol is Static, external metric is 0
    Administrator tag is 0 (0x00000000)
    Exterior flag is set [1]

MI-CAT3750-ME-SW-03側でルーティングテーブルを確認。
「D*EX 0.0.0.0/0 [170/7680] via 192.168.101.1, 00:00:51, FastEthernet1/0/1」の行のとおり、EIGRPの外部経路として載っている事がわかる。
ルーティングテーブルに載っていないユーザトラヒックは、MI-CAT3750-ME-SW-03のFa1/0/1に転送される。

MI-CAT3750-ME-SW-03#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
   D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
   N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
   E1 - OSPF external type 1, E2 - OSPF external type 2
   i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
   ia - IS-IS inter area, * - candidate default, U - per-user static route
   o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
   + - replicated route, % - next hop override
Gateway of last resort is 192.168.101.1 to network 0.0.0.0

D*EX 0.0.0.0/0 [170/7680] via 192.168.101.1, 00:00:51, FastEthernet1/0/1
   10.0.0.0/32 is subnetted, 3 subnets
D    10.1.1.1 [90/135680] via 192.168.101.1, 00:00:51, FastEthernet1/0/1
D    10.1.1.2 [90/133120] via 192.168.101.1, 00:00:51, FastEthernet1/0/1
C    10.1.1.3 is directly connected, Loopback0
D   192.168.100.0/24
     [90/7680] via 192.168.101.1, 00:00:51, FastEthernet1/0/1
   192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C    192.168.101.0/24 is directly connected, FastEthernet1/0/1
L    192.168.101.2/32 is directly connected, FastEthernet1/0/1
MI-CAT3750-ME-SW-03#

この状態で、debug ip eigrpコマンドを打ち、MI-CAT3750-ME-SW-02〜MI-CAT3750-ME-SW-03間のケーブルを抜挿すると、0.0.0.0のエントリがルーティングテーブルにインストールされる様子を見る事が出来る。
以下のdebugの出力内容の中で[2]と[3]の行が該当する。

MI-CAT3750-ME-SW-03#debug ip eigrp
EIGRP-IPv4 Route Event debugging is on
MI-CAT3750-ME-SW-03#
<span style="font-size: 85%">
*Sep 14 00:54:21.088: %LINK-3-UPDOWN: Interface FastEthernet1/0/1, changed state to up
*Sep 14 00:54:22.111: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to up
*Sep 14 00:54:23.235: %DUAL-5-NBRCHANGE: EIGRP-IPv4 1: Neighbor 192.168.101.1 (FastEthernet1/0/1)
 is up: new adjacency
*Sep 14 00:54:25.282: EIGRP-IPv4(1): Ext 0.0.0.0/0 M 7680 - 2560 5120 SM 5120 - 2560 2560 [2]
*Sep 14 00:54:25.282: EIGRP-IPv4(1): table(default): route installed for 0.0.0.0/0 (170/7680) 
origin(192.168.101.1) [3]

networkコマンドで注入する方法
2.次は、network 0.0.0.0の方法で。

Default Routeの設定が入っている場合、EIGRPの設定モードにてnetwork 0.0.0.0を投入するとredistributeコマンドを投入しなくてもDefault RouteをEIGRPネットワークにアドバタイズしてくれる。
EIGRPの設定にてnetwork 0.0.0.0を追加。
尚、上記1.にて投入したredistribute staticは前もって削除している。

MI-CAT3750-ME-SW-02#conf t
MI-CAT3750-ME-SW-02(config)#router eigrp 1
MI-CAT3750-ME-SW-02(config-router)#network 0.0.0.0
MI-CAT3750-ME-SW-02(config-router)#exit
MI-CAT3750-ME-SW-02(config)#exit
MI-CAT3750-ME-SW-02#

上記設定後、MI-CAT3750-ME-SW-02側にてルーティングテーブルを確認。
「S*  0.0.0.0/0 is directly connected, FastEthernet1/0/2」の行が載った。

MI-CAT3750-ME-SW-02#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
   D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
   N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
   E1 - OSPF external type 1, E2 - OSPF external type 2
   i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
   ia - IS-IS inter area, * - candidate default, U - per-user static route
   o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
   + - replicated route, % - next hop override
Gateway of last resort is 0.0.0.0 to network 0.0.0.0

S*  0.0.0.0/0 is directly connected, FastEthernet1/0/2
   10.0.0.0/32 is subnetted, 3 subnets
D   10.1.1.1 [90/133120] via 192.168.100.1, 00:02:04, FastEthernet1/0/1
C    10.1.1.2 is directly connected, Loopback0
D    10.1.1.3 [90/133120] via 192.168.101.2, 00:01:58, FastEthernet1/0/2
   192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C    192.168.100.0/24 is directly connected, FastEthernet1/0/1
L    192.168.100.2/32 is directly connected, FastEthernet1/0/1
   192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C    192.168.101.0/24 is directly connected, FastEthernet1/0/2
L    192.168.101.1/32 is directly connected, FastEthernet1/0/2
MI-CAT3750-ME-SW-02#

この状態でshow ip eigrp topology 0.0.0.0コマンドを叩くと、出力内容一番下の[4]に出力されているとおり、Exterior Flagが0.0.0.0のエントリーに立っている事がわかる。

Default Routeに設定されたNext Hopは「ラストリゾート ゲートウェイ」と呼ばれる。
上記show ip routeの出力内容「Gateway of last resort is 192.168.101.1 to network 0.0.0.0」の場合、Default RouteのNext Hop、つまりラストリゾート ゲートウェイは192.168.101.1となる。
ちなみに、Default Routeである0.0.0.0のEIGRPトポロジテーブルにはExterior Flagが立てられて、EIGRPネイバにアドバタイズされる。

MI-CAT3750-ME-SW-02#sh ip eigrp topology 0.0.0.0
EIGRP-IPv4 Topology Entry for AS(1)/ID(10.1.1.2) for 0.0.0.0/0
 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 5120
 Descriptor Blocks:
 0.0.0.0, from Rstatic, Send flag is 0x0
   Composite metric is (5120/0), route is Internal
   Vector metric:
    Minimum bandwidth is 1000000 Kbit
    Total delay is 100 microseconds
    Reliability is 255/255
    Load is 1/255
    Minimum MTU is 1500
    Hop count is 0
    Originating router is 10.1.1.2
   Exterior flag is set [4]

MI-CAT3750-ME-SW-03側でルーティングテーブルを確認。
「D*  0.0.0.0/0 [90/7680] via 192.168.101.1, 00:02:22, FastEthernet1/0/1」の出力のとおり、
今度はEXのFlagが立っていない為、内部経路として載っている事がわかる。

MI-CAT3750-ME-SW-03#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
   D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
   N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
   E1 - OSPF external type 1, E2 - OSPF external type 2
   i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
   ia - IS-IS inter area, * - candidate default, U - per-user static route
   o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
   + - replicated route, % - next hop override

Gateway of last resort is 192.168.101.1 to network 0.0.0.0

D*  0.0.0.0/0 [90/7680] via 192.168.101.1, 00:02:22, FastEthernet1/0/1
   10.0.0.0/32 is subnetted, 3 subnets
D    10.1.1.1 [90/135680] via 192.168.101.1, 00:02:22, FastEthernet1/0/1
D    10.1.1.2 [90/133120] via 192.168.101.1, 00:02:22, FastEthernet1/0/1
C    10.1.1.3 is directly connected, Loopback0
D   192.168.100.0/24
     [90/7680] via 192.168.101.1, 00:02:22, FastEthernet1/0/1
   192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C    192.168.101.0/24 is directly connected, FastEthernet1/0/1
L    192.168.101.2/32 is directly connected, FastEthernet1/0/1
MI-CAT3750-ME-SW-03#

この状態で、debug ip eigrpコマンドを打ち、MI-CAT3750-ME-SW-02〜MI-CAT3750-ME-SW-03間のケーブルを抜挿すると、0.0.0.0のエントリがルーティングテーブルにインストールされる様子を見る事が出来る。
以下のdebugの出力内容の中で[5]と[6]の行が該当する。

MI-CAT3750-ME-SW-03#debug ip eigrp
EIGRP-IPv4 Route Event debugging is on
MI-CAT3750-ME-SW-03#

*Sep 14 01:04:54.045: %LINK-3-UPDOWN: Interface FastEthernet1/0/1, changed state to up
*Sep 14 01:04:55.052: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to up
*Sep 14 01:04:59.137: %DUAL-5-NBRCHANGE: EIGRP-IPv4 1: Neighbor 192.168.101.1 (FastEthernet1/0/1)
 is up: new adjacency
*Sep 14 01:05:01.192: EIGRP-IPv4(1): Int 0.0.0.0/0 M 7680 - 2560 5120 SM 5120 - 2560 2560 [5]
*Sep 14 01:05:01.192: EIGRP-IPv4(1): table(default): route installed for 0.0.0.0/0 (90/7680) origin(192.168.101.1)
*Sep 14 01:05:01.192: EIGRP-IPv4(1): Int 10.1.1.3/32 M 4294967295 - 2560 4294967295 SM 
4294967295 - 2560 4294967295 [6]
MI-CAT3750-ME-SW-03#


リンク集
https://debslink.hatenadiary.jp/entry/20150416/1429195527 EIGRPのLocal Computation
https://debslink.hatenadiary.jp/entry/20150415/1429107405 EIGRPのDiffusing Computation
https://debslink.hatenadiary.jp/entry/20150419/1429422783 EIGRPのDiffusing Computation メトリック値変更編
https://debslink.hatenadiary.jp/entry/20150425/1429926903 EIGRPのDiffusing Computation SIA編
https://debslink.hatenadiary.jp/entry/20150503/1430659609 EIGRPのDiffusing Computation 経路追加編
https://debslink.hatenadiary.jp/entry/20150417/1429268810 EIGRPの優先ルートの選定 offset-list編