1.概述

      EIGRP能够被配置来负载平衡最多四条不等成本的路径。这个性能被称为不等成本负载平衡,使用variance命令实现,缺省时,路由器将会负载平衡四条等成本道路。variance命令让你设置更差的可选道路(以度量值为依据),还能被用来进行负载平衡。

例如,路由器R2有两条到达网络3.3.3.0的路径,一条的成本是4,另一条的成本是8,缺省时只会使成本为4的路径来发送包到3.3.3.3。如果被设置了variance命令,路由器将会在道路间进行负载平衡。之所以发生这种情况是因为费用为8的路径在variance内,它是最优路径的两倍(4(最优路径)×2 = 8)。

2.配置概述

       这个配置将会验证variance命令的使用,这允许EIGRP启动的路由器在不等成本道路间进行负载平衡。variance命令被设置到路由器R2上,所以到达网络3.3.3.3的两条道路都被使用。

       路由器R2R6R3用一个交叉电缆串行的接在一起,路由器R2R6还经过一个以太网交换机连在一起。

      路由器R6作为DCE,向路由器R2和提供时钟,各自的IP地址如图7 - 8所示。所有路由器都配置了EIGRP,路由器R2将被用来进行负载平衡交通,通过到达3.3.3.3的两条不等成本道路。

wKioL1nRzr2xlwGjAADtvbnw244882.jpg-wh_50

 EIGRP不等成本负载平衡

3.路由器配置

这个例子中的三个路由器的配置如下所示:

(1. )路由器R2

 R2#showrunn


interface Loopback0

 ip address 2.2.2.2255.255.255.0

!

interface Ethernet1/1

 ip address62.62.62.2 255.255.255.0

 half-duplex

!

interface Serial0/2

 ip address26.26.26.2 255.255.255.0

 serialrestart-delay 0

 clock rate64000

!

router EIGRP 90

 variance 2

 network 2.0.0.0

 network26.0.0.0

 network62.0.0.0

 auto-summary

!


(2.) 路由器R6

R6#show runn


!

interface Loopback0

 ip address 6.6.6.6255.255.255.0

!

interface Ethernet1/1

 ip address62.62.62.6 255.255.255.0

 half-duplex

!

interface Serial0/2

 ip address26.26.26.6 255.255.255.0

 serialrestart-delay 0

 clock rate64000

!

interface Serial0/3

 ip address36.36.36.6 255.255.255.0

 serialrestart-delay 0

 clock rate64000

!

router EIGRP 90

 network 6.0.0.0

 network26.0.0.0

 network36.0.0.0

 network62.0.0.0

 auto-summary

!


3. 路由器R3

 R3#showrunn

!

interface Loopback0

 ip address 3.3.3.3255.255.255.0

!

interface Serial0/3

 ip address36.36.36.3 255.255.255.0

 serial restart-delay0

 clock rate64000

!        

router EIGRP 90

 network 3.0.0.0

 network36.0.0.0

 auto-summary

!


!

4.监测配置

        使用命令show ip route显示在路由器R2上的路由表。

       注意有两条到网络3.0.0.0的路径:一条经过以太网接口,另一条经过串行接口。通过这两条道路到达网络的成本是不同的;

       但是因为variance设为2,既然第二条道路的成本不比最优道路的两倍多,那么就使用这条道路


      让我们仔细看一下这种情况,到达网络3.0.0.0的最优路径是经过以太网接口的,它的成本是2 323 456。因为两者都有variance,而其它任何到达网络3.0.0.0的路径的成本都比4 646 912 2 323 456×2)少,那么就使用这条路径。因为通过串行接口的费用是2 809 856,它比4 646 912少,所以使用这条路径。


R2#show ip route

Gateway of last resort is not set

 

    2.0.0.0/8is variably subnetted, 2 subnets, 2 masks

C       2.2.2.0/24is directly connected, Loopback0

D       2.0.0.0/8is a summary, 00:00:45, Null0

D    3.0.0.0/8[90/2323456] via 62.62.62.6, 00:00:46, Ethernet1/1

              [90/2809856] via 26.26.26.6, 00:00:46, Serial0/2

D   36.0.0.0/8 [90/2195456] via 62.62.62.6, 00:00:46, Ethernet1/1

               [90/2681856] via 26.26.26.6, 00:00:46, Serial0/2

     6.0.0.0/8is variably subnetted, 2 subnets, 2 masks

D       6.6.6.0/24[90/2297856] via 26.26.26.6, 00:05:50, Serial0/2

D       6.0.0.0/8[90/409600] via 62.62.62.6, 00:00:46, Ethernet1/1

    26.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C      26.26.26.0/24 is directly connected, Serial0/2

D      26.0.0.0/8 is a summary, 00:00:46, Null0

    62.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C      62.62.62.0/24 is directly connected, Ethernet1/1

D      62.0.0.0/8 is a summary, 00:00:49, Null0

使用命令show ip route 3.3.3.3在路由器R2上显示到达3.3.3.3的路径。注意两条路径都被使用,在第二条路径旁有一个星号*。这个*表示下一个离开路由器R2的包目标是3.3.3.3要使用这条路径。


R2#show ip route 3.3.3.3

Routing entry for 3.0.0.0/8

  Known via"eigrp 90", distance 90, metric 2323456, type internal

 Redistributing via eigrp 90

  Lastupdate from 62.62.62.6 on Ethernet1/1, 00:11:30 ago

  RoutingDescriptor Blocks:

   62.62.62.6, from 62.62.62.6, 00:11:30 ago, via Ethernet1/1

      Routemetric is 2323456, traffic share count is 40

      Totaldelay is 26000 microseconds, minimum bandwidth is 1544 Kbit

     Reliability 255/255, minimum MTU 1500 bytes

     Loading 1/255, Hops 2

  *26.26.26.6, from 26.26.26.6, 00:11:30 ago, via Serial0/2

      Routemetric is 2809856, traffic share count is 33

      Totaldelay is 45000 microseconds, minimum bandwidth is 1544 Kbit

     Reliability 255/255, minimum MTU 1500 bytes

     Loading 1/255, Hops 2



在路由器R2上,测试主机3.3.3.3是否连通。

R2#ping 3.3.3.3

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3,timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-tripmin/avg/max = 8/59/164 ms


       现在在路由器R2上运行命令show ip route 3.3.3.3显示到达主机3.3.3.3的路径。注意现在*  在第二条路径旁,因为路由器现在正在两条链路上负载平衡。这两条链路都是到网络3.0.0.0的。


R2#show ip route 3.3.3.3

Routing entry for 3.0.0.0/8

  Known via"EIGRP 90", distance 90, metric 2323456, type internal

 Redistributing via EIGRP 90

  Lastupdate from 62.62.62.6 on Ethernet0/0, 00:18:30 ago

  RoutingDescriptor Blocks:

   *62.62.62.6, from 62.62.62.6, 00:18:30 ago, via Ethernet0/0

      Routemetric is 2323456, traffic share count is 40

      Totaldelay is 26000 microseconds, minimum bandwidth is 1544 Kbit

     Reliability 255/255, minimum MTU 1500 bytes

     Loading 1/255, Hops 2

     26.26.26.6, from 26.26.26.6, 00:18:30 ago,via Serial1/0

      Routemetric is 2809856, traffic share count is 33

      Totaldelay is 45000 microseconds, minimum bandwidth is 1544 Kbit

     Reliability 255/255, minimum MTU 1500 bytes

     Loading 1/255, Hops 2


使用路由器配置命令novariance取消路由器R2上的variance命令。

R2(config)#router ei90

R2(config-router)#novariance



在路由器R2使用命令show ip route 3.3.3.3显示到达主机3.3.3.3的路径注意只使用了一条路径。这条路径有最低的度量值,也没有运行负载平衡。

R2#show ip route 3.3.3.3

Routing entry for 3.0.0.0/8

  Known via"eigrp 90", distance 90, metric 2323456, type internal

 Redistributing via eigrp 90

  Lastupdate from 62.62.62.6 on Ethernet1/1, 00:00:09 ago

  RoutingDescriptor Blocks:

  *62.62.62.6, from 62.62.62.6, 00:00:09 ago, via Ethernet1/1

      Routemetric is 2323456, traffic share count is 1

      Totaldelay is 26000 microseconds, minimum bandwidth is 1544 Kbit

     Reliability 255/255, minimum MTU 1500 bytes

     Loading 1/255, Hops 2