EIGRP中的非等价负载均衡
R1:
R1#sh run
interface Loopback0
ip address 1.1.1 .1 255.255.255.0
interface FastEthernet0/0
ip address 12.1.1 .1 255.255.255.0
interface FastEthernet1/0
ip address 12.2.1 .1 255.255.255.0
interface Serial2/0
ip address 12.3.1 .1 255.255.255.0
router eigrp 1
network 1.1.1 .0 0.0.0.255
network 12.1.1 .0 0.0.0.255
network 12.2.1 .0 0.0.0.255
network 12.3.1 .0 0.0.0.255
no auto-summary
R2:
interface Loopback0
ip address 2.2.2 .2 255.255.255.0
interface FastEthernet0/0
ip address 12.1.1 .2 255.255.255.0
interface FastEthernet1/0
ip address 12.2.1 .2 255.255.255.0
interface Serial2/0
ip address 12.3.1 .2 255.255.255.0
router eigrp 1
network 2.2.2 .0 0.0.0.255
network 12.1.1 .0 0.0.0.255
network 12.2.1 .0 0.0.0.255
network 12.3.1 .0 0.0.0.255
no auto-summary
查看R1的路由表:
R1#sh ip ro
Gateway of last resort is not set
1.0.0 .0/24 is subnetted, 1 subnets
C 1.1.1 .0 is directly connected, Loopback0
2.0.0 .0/24 is subnetted, 1 subnets
D 2.2.2 .0 [90/156160] vi a 12.2.1 .2, 00:01:29, FastEthernet1/0
[90/156160] vi a 12.1.1 .2, 00:01:29, FastEthernet0/0
12.0.0 .0/24 is subnetted, 3 subnets
C 12.1.1 .0 is directly connected, FastEthernet0/0
C 12.3.1 .0 is directly connected, Serial2/0
C 12.2.1 .0 is directly connected, FastEthernet1/0
可以看到,去往 2.2.2 .0 从两条FastEthernet走。
命令variance用于不等价负载均衡,默认variance = 1,也就是只支持等价负载均衡的意义。
查看R1的拓扑表:
R1#sh ip ei topology
P 2.2.2 .0/24, 2 successors, FD is 156160
vi a 12.1.1 .2 (156160/128256), FastEthernet0/0
vi a 12.2.1 .2 (156160/128256), FastEthernet1/0
vi a 12.3.1 .2 (2297856/128256), Serial2/0
R1通过Serial2/0去往 2.2.2 .0网络的FD = 2297856
R1通过FastEthernet0/0或者FastEthernet1/0去往 2.2.2 .0网络的FD = 156160
公式:FD * variance > AD
Variance = 2297856 / 156160 = 15
所以,为了实现非等价负载均衡,修改R1的variance = 15
R1(config)#router eigrp 1
R1(config-router)#variance 15
再次查看R1的路由表:
R1#sh ip ro
D 2.2.2 .0 [90/2297856] vi a 12.3.1 .2, 00:00:34, Serial2/0
[90/156160] vi a 12.2.1 .2, 00:00:34, FastEthernet1/0
[90/156160] vi a 12.1.1 .2, 00:00:34, FastEthernet0/0
现在去往 2.2.2 .0网路的路径变成了3条。
命令:maximum-paths
用于修改EIGRP非等价负载均衡的最大条数
修改R1最大2条:
R1(config)#router ei 1
R1(config-router)#maximum-paths 2
查看路由表:
R1(config-router)#do sh ip ro
D 2.2.2 .0 [90/156160] vi a 12.2.1 .2, 00:00:05, FastEthernet1/0
[90/156160] vi a 12.1.1 .2, 00:00:05, FastEthernet0/0
去往 2.2.2 .0网路的路径又变成了两条。
上述试验中如有错误,欢迎提出,谢谢~