天天看點

修改EIGRP 路徑cost 值,以及分析和實作等價與非等價負載均衡

一、拓撲圖:

二、配置各路由器的IP和EIGRP 協定,并保證鄰接關系的形成。

1、我要達到的目的是要讓R2到192.168.14.0/24這個網段能在R2和R1斷開之後,形成網網絡的快速收斂。因為根據EIGRP 的次優路徑進拓撲關系的形成條件是要滿足FC(feasible condition)=FD(feasible distance)>AD(通告距離,也就是下一跳路由器到目的網段這一距離)。這個條件也是為什麼EIGRP是100%無環路的原因。現在我們看一下R2的EIGRP 拓撲:

R2#show ip eigrp to

IP-EIGRP Topology Table for AS(100)/ID(192.168.23.2)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,

       r - reply Status, s - sia Status

P 192.168.34.0/24, 1 successors, FD is 2172416

        via 192.168.23.3 (2172416/28160), Serial0/1

P 192.168.12.0/24, 1 successors, FD is 28160

        via Connected, FastEthernet1/0

P 192.168.14.0/24, 1 successors, FD is 2172416

        via 192.168.12.1 (2172416/2169856), FastEthernet1/0

P 192.168.23.0/24, 1 successors, FD is 2169856

        via Connected, Serial0/1

R2#

2、通過上面的topology,我們看到R2有一個P(passive)到192.168.14.0隻有一條FD。那麼我們想什麼辦法去滿足在R2上形成FD>AD。把次優路徑放進拓撲中,讓EIGRP在另一條鍊路DOWN 後形成一個快速收斂的過程。我們在R2上看到這麼一條:

下面再看一下R3:

R3#sho ip eigrp to

IP-EIGRP Topology Table for AS(100)/ID(192.168.34.3)

P 192.168.34.0/24, 1 successors, FD is 28160

P 192.168.12.0/24, 1 successors, FD is 2172416

        via 192.168.23.2 (2172416/28160), Serial0/1

        via 192.168.34.4 (2172416/2169856), FastEthernet1/0

R3#

R2#show 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 FastEthernet1/0 will have 1 added to metric if on list 1

  Incoming routes in FastEthernet1/0 will have 1 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 2  (現在變成2了)

  Redistributing: eigrp 100

  EIGRP NSF-aware route hold timer is 240s

  Automatic network summarization is not in effect

  Maximum path: 4

  Routing for Networks:

    192.168.12.0

    192.168.23.0

  Routing Information Sources:

    Gateway         Distance      Last Update

    192.168.12.1          90      00:25:56

    192.168.23.3          90      00:25:56

  Distance: internal 90 external 170

4、  我們再看一下R2的路由:

R2#show ip route

Codes: 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

Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet1/0

D    192.168.14.0/24 [90/2684416] via 192.168.23.3, 00:29:04, Serial0/1

                     [90/2172417] via 192.168.12.1, 00:29:04, FastEthernet1/0

C    192.168.23.0/24 is directly connected, Serial0/1

D    192.168.34.0/24 [90/2172416] via 192.168.23.3, 00:29:04, Serial0/1

D    192.168.1.0/24 [90/156160] via 192.168.12.1, 00:29:04, FastEthernet1/0

 看到了有兩條路徑可以走了,也就是實作了EIGRP 非等價負載均衡。

五、分析一下非等價負載均衡包的轉發情況:

1、我先在R2上關上cef 包交換

R2(config)#no ip cef

2、  我再來看一下到192.168.14.0路徑的路由情況:

R2#show ip route 192.168.14.0

Routing entry for 192.168.14.0/24

  Known via "eigrp 100", distance 90, metric 2172417, type internal

  Redistributing via eigrp 100

  Last update from 192.168.23.3 on Serial0/1, 00:37:03 ago

  Routing Descriptor Blocks:

    192.168.23.3, from 192.168.23.3, 00:37:03 ago, via Serial0/1

      Route metric is 2684416, traffic share count is 97

      Total delay is 40100 microseconds, minimum bandwidth is 1544 Kbit

      Reliability 255/255, minimum MTU 1500 bytes

      Loading 1/255, Hops 2

  * 192.168.12.1, from 192.168.12.1, 00:37:03 ago, via FastEthernet1/0

      Route metric is 2172417, traffic share count is 120

      Total delay is 20100 microseconds, minimum bandwidth is 1544 Kbit

      Loading 1/255, Hops 1

3、根據上面的情況,我看到了R2到192.168.14.0先走192.168.12.1轉發120個count,然後再會走192.168.23.3 再轉發97個count。正是因為一個轉120 count,一個轉97 count,我想也就是叫非等價的原因。

3、我們看到了:

EIGRP 改COST值:如果改帶寬,改K值,這樣會影響整個鍊路。如果隻想把一條路徑加進topology。這樣我們隻要R3到192.168.14.0 的FD(如果形成次路徑,此段也就是R2到192.168.14.0的AD),讓它滿足小于R2到192.168.14.0 的FD。即FD>AD.就會把這條鍊路放進拓撲中。

三、下面可以用offset list指令偏移cost 值。把R2到192.168.14.0 這一段改大,我們可以在R1的出口,或者是R2的進口來做。但要注意,改大cost值對鍊路是沒影響的因為它還是處于passive 狀态,但如果把鍊路改小的話,它會有一個active 的過程。這個在TCP/IP卷裡面有詳細說明。

1、下面我在R1上做一個out方向來啟用offset :

R1(config)#access-list 1 permit 192.168.12.0 0.0.0.255(通告192.168.14.0給R2時調用這cost )

R1(config)#router eigrp 100

R1(config-router)#offset-list 1 out 1 fastEthernet1/0  (我讓它在R1的F1/0這個出口上調用上access-list 1)

2、OK,現在R2到192.168.14.0/24的FD偏移了1,變成了2172417。

R2#show ip eigrp topology

P 192.168.14.0/24, 1 successors, FD is 2172417

        via 192.168.12.1 (2172417/2169857), FastEthernet1/0

        via 192.168.23.3 (2684416/2172416), Serial0/1 (這個值就是R2到192.168.14.0的AD)

P 192.168.1.0/24, 1 successors, FD is 156160

        via 192.168.12.1 (156160/128256), FastEthernet1/0

四、在R2上實作非等價負載均衡:

1、通過偏移cost值之後,下面我們再看一下R2的路由表:

D    192.168.14.0/24 [90/2172417] via 192.168.12.1, 00:10:52, FastEthernet1/0

D    192.168.34.0/24 [90/2172416] via 192.168.23.3, 00:10:52, Serial0/1

D    192.168.1.0/24 [90/156160] via 192.168.12.1, 00:10:53, FastEthernet1/0

2、通過上面的顯示情況,R2到192.168.14.0這個網段是走R2這條路徑過去,因為偏移隻是把次路徑放入topology,并沒有放入路由表,那麼我現在想讓它放入路由表,這樣可以實作通過兩條路徑到192.168.14.0。有效的實作了非等價負載均衡。但是必須要讓它滿足一個條件,就是R2 的successor(FD)×variance 值≥Feasible Successor,預設情況下variance 等于1,這樣就是等價均衡,我隻要把R2上面FD乘以2就能形成非等價負載均衡:

R2(config)#router eigrp 100

R2(config-router)#variance 2

3、  通過上面的修改,我們現在再看一下R2的variance :

本文轉自wxs-163 51CTO部落格,原文連結:http://blog.51cto.com/supercisco/248232

繼續閱讀