Eigrp负载均衡
(1)路由器的配置
R1配置:
hostname R1
interface Serial0/0
ip address 192.168.12.1 255.255.255.0
serial restart-delay 0
interface FastEthernet1/0
ip address 192.168.14.1 255.255.255.0
duplex auto
speed auto
router eigrp 1
network 192.168.12.0
network 192.168.14.0
no auto-summary
line con 0
exec-timeout 0 0
logging synchronous
R2配置:
hostname R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial0/0
ip address 192.168.12.2 255.255.255.0
serial restart-delay 0
clock rate 128000
!
interface Serial0/1
ip address 192.168.23.2 255.255.255.0
serial restart-delay 0
clock rate 128000
router eigrp 1
network 2.2.2.0 0.0.0.255
network 192.168.12.0
network 192.168.23.0
no auto-summary
line con 0
exec-timeout 0 0
logging synchronous
R3配置:
hostname R3
interface Serial0/0
ip address 192.168.34.3 255.255.255.0
serial restart-delay 0
clock rate 128000
!
interface Serial0/1
ip address 192.168.23.3 255.255.255.0
serial restart-delay 0
router eigrp 1
network 192.168.23.0
network 192.168.34.0
no auto-summary
line con 0
exec-timeout 0 0
logging synchronous
R4配置:
hostname R4
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Serial0/0
ip address 192.168.34.4 255.255.255.0
serial restart-delay 0
interface FastEthernet1/0
ip address 192.168.14.4 255.255.255.0
delay 10
duplex auto
speed auto
!
router eigrp 1
network 4.4.4.0 0.0.0.255
network 192.168.14.0
network 192.168.34.0
no auto-summary
line con 0
exec-timeout 0 0
logging synchronous
R4#show ip route
D 192.168.12.0/24 [90/2172416] via 192.168.14.1, 00:11:39, FastEthernet1/0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/2300416] via 192.168.14.1, 00:11:39, FastEthernet1/0
C 192.168.14.0/24 is directly connected, FastEthernet1/0
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
D 192.168.23.0/24 [90/2681856] via 192.168.34.3, 00:11:39, Serial0/0
C 192.168.34.0/24 is directly connected, Serial0/0
默认走快速以太网去2.2.2.2
R4#show ip eigrp topology
P 2.2.2.0/24, 1 successors, FD is 2300416
via 192.168.14.1 (2300416/2297856), FastEthernet1/0
via 192.168.34.3 (2809856/2297856), Serial0/0
P 4.4.4.0/24, 1 successors, FD is 128256
via Connected, Loopback0
P 192.168.34.0/24, 1 successors, FD is 2169856
via Connected, Serial0/0
P 192.168.12.0/24, 1 successors, FD is 2172416
via 192.168.14.1 (2172416/2169856), FastEthernet1/0
P 192.168.14.0/24, 1 successors, FD is 28160
via Connected, FastEthernet1/0
P 192.168.23.0/24, 1 successors, FD is 2681856
via 192.168.34.3 (2681856/2169856), Serial0/0
最优FD为2300416,第二条路径的AD为2297856,AD<FD,满足可行性条件,所以第二天路径是最优路由的可行后继。
(2)可以通过适当的配置,使得R4上看R2的loopback0的路由条目为等价路由,从而实现等价负载均衡,这2条路径的最小带宽是相同的,只要延时之和相同就是等价路由,在R4上 做如下设置:
R4(config)#interface fastEthernet 1/0
R4(config-if)#delay 2000
备注:在接口下用delay命令修改的延时,在计算度量值时不需要再除以10.
R4#show ip route eigrp
D 192.168.12.0/24 [90/2681856] via 192.168.14.1, 00:01:09, FastEthernet1/0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/2809856] via 192.168.34.3, 00:01:09, Serial0/0
[90/2809856] via 192.168.14.1, 00:01:09, FastEthernet1/0
D 192.168.23.0/24 [90/2681856] via 192.168.34.3, 00:01:09, Serial0/0
可以发现现在这2条路径是等价的。
(3)可以用“variance”命令来实现eigrp的非等价负载均衡
R4(config)#router eigrp 1
R4(config-router)#variance 2
R4#show ip route eigrp
D 192.168.12.0/24 [90/2172416] via 192.168.14.1, 00:03:29, FastEthernet1/0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/2809856] via 192.168.34.3, 00:03:29, Serial0/0
[90/2300416] via 192.168.14.1, 00:03:29, FastEthernet1/0
D 192.168.23.0/24 [90/2681856] via 192.168.34.3, 00:03:29, Serial0/0
Eigrp非等价负载均衡是通过variance命令实现的,variance默认是1,variance值得范围是1-128.
转载于:https://blog.51cto.com/sunbo2012/817394