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的兩條道路都被使用。
路由器R2、R6、R3用一個交叉電纜串行的接在一起,路由器R2和R6還經過一個以太網交換機連在一起。
路由器R6作為DCE,向路由器R2和提供時鐘,各自的IP地址如圖7 - 8所示。所有路由器都配置了EIGRP,路由器R2將被用來進行負載平衡交通,通過到達3.3.3.3的兩條不等成本道路。
圖 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
閱讀更多 思恆科技 的文章