eigrp的不等價負載均衡

1、等價負載均衡

當到達目的地有多條路徑時,而有多條路徑的metric值一樣,這時就可以做等價負載均衡,讓數據包均衡轉發,不過要看該路由器的轉發方式,如果是快速轉發方式,這種方式無用(本地產生的數據包除外)。

2、非等價負載均衡

只有eigrp可以做非等價負載均衡,意思是,到達同一目的地有多條路徑,而它們的度量值不一樣時,可以做非等價負載均衡,可以通過設置variance值來進行不等價負載均衡,即兩數相除取整加1,滿足此條件的線路就可以按非等價負載均衡的方式發送數據包,非等價最大支持16條(猜的,不一定),也要看數據包的轉發方式,如果是快速轉發方式,效果但不到,但是對於本地產生的數據包可以實現非等價,因爲此時,本地產生的數據包還是按進程轉發方式轉發數據包的,對其他路由器的數據包,要關閉快速轉發,可以啓用cef,且cef對本地的數據包也是產生效果的,記住,不能更改默認的均衡方式,即默認的traffic-share balanced命令不能被修改!

1、EIGRP默認支持四條鏈路的不等代價的負載均衡(所有路由基本上都支持);
2、使用下面命令可支持六條:
router EIGRP 10
maximum-paths 6——設置成6條
variance——後跟差異度量值,實現負載均衡。差異值爲1時,只有相同度量纔會安置到本地路由表中,爲2時,任一由EIGRP發現的瞭解的路由,只有其度量少於繼任度量的兩倍,將會被安置到本地的路由表中。

在做實驗之前我想先解釋一下實現EIGRP負載的一些知識(圖)!
eigrp的不等價負載均衡
一:思考
如果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,所以不滿足,不能實現負載.
    實驗:拓撲如下
    eigrp的不等價負載均衡
    注:寫了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//這裏因爲改變F0/1了帶寬,所以去住4.4.4.4全部往F0/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#

R1(config)#do sh ip eigrp topo
IP-EIGRP Topology Table for AS 1
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - Reply status
P 192.168.12.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 192.168.13.0/24, 1 successors, FD is 5002496
via Connected, FastEthernet0/1
P 192.168.24.0/24, 1 successors, FD is 30720
via 192.168.12.2 (30720/28160), FastEthernet0/0
P 192.168.34.0/24, 1 successors, FD is 33280
via 192.168.12.2 (33280/30720), FastEthernet0/0
via 192.168.13.2 (5005056/28160), FastEthernet0/1
P 4.4.4.4/32, 1 successors, FD is 158720
via 192.168.12.2 (158720/156160), FastEthernet0/0
via 192.168.13.2 (5133056/156160), FastEthernet0/1//通過查看拓撲表可以知道通過R2到R4的可行距離FD=158720,而通過R3到R4的可行距離FD=5133056。
步驟三:實現非等價負載均衡
R1(config)#router eigrp 1
R1(config-router)#variance 33 // 33=[5133056/158720]+1,滿足條件.
查看路由表:
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的路由,又變成了兩條.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章