在做实验之前我想先解释一下实现EIGRP负载的一些知识()!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

一:思考

如果 R1 想去去往 R5 的话,那么它面临着有 3 条路可以走,但是我们可以请注意到, 3 条路的度量值是不一样的,所以度量值不一样即不能实现负载均衡,于是 R1 就会选择 R3 做为它的下一跳,把它放入路由表当中 , 那我们怎样实现非等价负载呢(即带宽不一致的情况)?

 

二:术语

AD Advertise Distance : 宣告距离 (邻居到某网络的距离)   

FD (Feasible Distance) :可行距离    (自己到某网络的距离)

如图所示 : 如果 R1 R3 R5 ,那么它的 AD=10 FD=20.

 

注:这个一定得搞清,不然接下来都不知道我讲什么 .

 

三:条件

 

1.    如果我在 R1 配置 R1 config-router #variance 2 的话,那么 R2 会做为 R1 的另一条去住 R5 的路径,因为 2* FD > 20+10=30 ),即从 R2 R5 FD 小于 R3 R5 FD ,所以才能实现负载 .

 

2. 如果我 variance 设置为 3 的话,那么按我刚刚所说的从 R4 R5 FD 也小于 2* FD ),那它会被加入的负载路径里面去吗?答案肯定不会,因为还有一个条件就是AD必需小于FD,从R4到R5的AD为25,而从R3到R5的FD为20, 所以不满足,不能实现负载 .

 

 

 

实验:拓扑如下

 

 

注:首先说明一下,由于 51CTO 只允许写 8 万字,所以步骤一只写了 R1 的配置,其它一样

 
步骤一:首先先把所以接口信息以及EIGRP 全部启用,并且查看信息 .

 

R1:

 

Router>

Router>en

Router#conf t

Router(config)#hostname R1

R1(config)#interface f0/0

R1(config-if)#ip address 192.168.12.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#ip address 192.168.13.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#router eigrp 1

R1(config-router)#no auto-summary

R1(config-router)#network 192.168.12.0 0.0.0.255

R1(config-router)#network 192.168.13.0 0.0.0.255

R1(config-if)#end

R1#

 

 

 

 

 

R1 上查看路由表:

 

R1#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

       i - IS-IS, 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

 

     4.0.0.0/24 is subnetted, 1 subnets

D       4.4.4.0 [90/158720] via 192.168.13.2, 00:00:06, FastEthernet0/1

                [90/158720] via 192.168.12.2, 00:00:06, FastEthernet0/0

C    192.168.12.0/24 is directly connected, FastEthernet0/0

C    192.168.13.0/24 is directly connected, FastEthernet0/1

D    192.168.24.0/24 [90/30720] via 192.168.12.2, 00:04:00, FastEthernet0/0

D    192.168.34.0/24 [90/30720] via 192.168.13.2, 00:03:50, FastEthernet0/1

R1#

 

注:很清楚的看到,去往4.4.4.4 有两条路可以走,因为其度量值一样,EIGRP 自动实现负载均衡,

 

 

 

 

 

步骤二: R1 设置F0/1 接口带宽为 512KB ,其两边度量值不一样,使得所以数据只向 F0/0 转发 , 产查看路由表与拓扑表 .

 

R1(config)#interface f0/1

R1(config-if)#bandwidth 512

R1(config-if)#end

R1#

 

 

查看路由表:

 

R1#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

       i - IS-IS, 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

 

     4.0.0.0/24 is subnetted, 1 subnets

D       4.4.4.0 [90/158720] via 192.168.12.2, 00:08:43, FastEthernet0/0

C    192.168.12.0/24 is directly connected, FastEthernet0/0

C    192.168.13.0/24 is directly connected, FastEthernet0/1

D    192.168.24.0/24 [90/30720] via 192.168.12.2, 00:12:37, FastEthernet0/0

D    192.168.34.0/24 [90/33280] via 192.168.12.2, 00:01:04, FastEthernet0/0

R1#

 

//这里因为改变F0/1 了带宽,所以去住4.4.4.4 全部往F0/0 转发 . 只有一条 .

 

 

 

 

 

步骤三:实现非等价负载均衡

 

R1(config)#router eigrp 1

R1(config-router)#variance 32    //    32=5133056 除以158720,满足条件.

 

查看路由表:

 

R1#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

       i - IS-IS, 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

 

     4.0.0.0/24 is subnetted, 1 subnets

D       4.4.4.0 [90/5133056] via 192.168.13.2, 00:00:02, FastEthernet0/1

                [90/158720] via 192.168.12.2, 00:00:01, FastEthernet0/0

C    192.168.12.0/24 is directly connected, FastEthernet0/0

C    192.168.13.0/24 is directly connected, FastEthernet0/1

D    192.168.24.0/24 [90/30720] via 192.168.12.2, 00:00:01, FastEthernet0/0

D    192.168.34.0/24 [90/30720] via 192.168.13.2, 00:00:02, FastEthernet0/1

R1#

 

// 去往4.4.4.4 的路由,又变成了两条 .

 

 

实验完毕 .