一、拓扑图:

二、配置各路由器的IPEIGRP 协议,并保证邻接关系的形成。
1、我要达到的目的是要让R2192.168.14.0/24这个网段能在R2R1断开之后,形成网网络的快速收敛。因为根据EIGRP 的次优路径进拓扑关系的形成条件是要满足FCfeasible condition=FDfeasible distance>AD(通告距离,也就是下一跳路由器到目的网段这一距离)。这个条件也是为什么EIGRP100%无环路的原因。现在我们看一下R2EIGRP 拓扑:
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有一个Ppassive)到192.168.14.0只有一条FD。那么我们想什么办法去满足在R2上形成FD>AD。把次优路径放进拓扑中,让EIGRP在另一条链路DOWN 后形成一个快速收敛的过程。我们在R2上看到这么一条:
P 192.168.14.0/24, 1 successors, FD is 2172416
        via 192.168.12.1 (2172416/2169856), FastEthernet1/0
下面再看一下R3:
R3#sho ip eigrp to

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

 

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 28160

        via Connected, FastEthernet1/0

P 192.168.12.0/24, 1 successors, FD is 2172416

        via 192.168.23.2 (2172416/28160), Serial0/1

P 192.168.14.0/24, 1 successors, FD is 2172416

        via 192.168.34.4 (2172416/2169856), FastEthernet1/0

P 192.168.23.0/24, 1 successors, FD is 2169856

        via Connected, Serial0/1

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

R2#

 看到了有两条路径可以走了,也就是实现了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

      Reliability 255/255, minimum MTU 1500 bytes

      Loading 1/255, Hops 1

3、  根据上面的情况,我看到了R2192.168.14.0先走192.168.12.1转发120count,然后再会走192.168.23.3 再转发97count。正是因为一个转120 count,一个转97 count,我想也就是叫非等价的原因。
3、我们看到了:
P 192.168.14.0/24, 1 successors, FD is 2172416
        via 192.168.34.4 (2172416/2169856), FastEthernet1/0
EIGRP COST值:如果改带宽,改K值,这样会影响整个链路。如果只想把一条路径加进topology。这样我们只要R3192.168.14.0 FD(如果形成次路径,此段也就是R2192.168.14.0AD),让它满足小于R2192.168.14.0 FD。即FD>AD.就会把这条链路放进拓扑中。

 

三、下面可以用offset list命令偏移cost 值。把R2192.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.0R2时调用这cost )

R1(config)#router eigrp 100

R1(config-router)#offset-list 1 out 1 fastEthernet1/0  (我让它在R1F1/0这个出口上调用上access-list 1)

2OK,现在R2192.168.14.0/24FD偏移了1,变成了2172417
R2#show ip eigrp topology

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 2172417

        via 192.168.12.1 (2172417/2169857), FastEthernet1/0

        via 192.168.23.3 (2684416/2172416), Serial0/1 (这个值就是R2192.168.14.0AD)

P 192.168.1.0/24, 1 successors, FD is 156160

        via 192.168.12.1 (156160/128256), FastEthernet1/0

P 192.168.23.0/24, 1 successors, FD is 2169856

        via Connected, Serial0/1

四、在R2上实现非等价负载均衡:
1、通过偏移cost值之后,下面我们再看一下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/2172417] via 192.168.12.1, 00:10:52, 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:10:52, Serial0/1

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

2、通过上面的显示情况,R2192.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、  通过上面的修改,我们现在再看一下R2variance :