CCNP-EIGRP不等价负载均衡51CTO博客 - 威尼斯人

CCNP-EIGRP不等价负载均衡51CTO博客

2019年02月25日11时29分55秒 | 作者: 曜栋 | 标签: 不等价,等价,修正 | 浏览: 1545

CCNP-EIGRP不等价负载均衡:

试验拓扑:

 

 

 

试验方针:

EIGRP的不等价负载均衡。(由于等价的负载均衡比较简略,这儿评论不等价的负载均衡)


路由根本装备(略)

IP地址装备:

r1(config)#in s1/0
r1(config-if)#ip add 219.146.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#in s1/1
r1(config-if)#ip add 219.146.1.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#exi

r2(config)#in s1/0
r2(config-if)#ip add 219.146.2.1 255.255.255.0
r2(config-if)#no sh
r2(config-if)#in s1/1
r2(config-if)#ip add 219.146.1.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#exi

r3(config)#in s1/0
r3(config-if)#ip add 219.146.0.2 255.255.255.0
r3(config-if)#no sh
r3(config-if)#in s1/1
r3(config-if)#ip add 219.146.2.2 255.255.255.0
r3(config-if)#no sh
r3(config-if)#in s1/2
r3(config-if)#ip add 219.146.3.1 255.255.255.0
r3(config-if)#no sh
r3(config-if)#exi

r4(config)#in s1/0
r4(config-if)#ip add 219.146.3.2 255.255.255.0
r4(config-if)#no sh
r4(config-if)#exi

EIGRP装备:
r1(config)#router e 10
r1(config-router)#no au
r1(config-router)#net 219.146.0.0 0.0.1.255
r1(config-router)#exi

r2(config)#router e 10
r2(config-router)#no au
r2(config-router)#net 219.146.1.0 0.0.0.255
r2(config-router)#net 219.146.2.0 0.0.0.255
r2(config-router)#exi

r3(config)#router e 10
r3(config-router)#no au
r3(config-router)#net 219.146.0.0 0.0.0.255
r3(config-router)#net 219.146.2.0 0.0.1.255
r3(config-router)#exi

r4(config)#router e 10
r4(config-router)#no au
r4(config-router)#net 219.146.3.0 0.0.0.255y
r4(config-router)#exi

检查一下R1和R2路由表:

r1(config)#do sh ip rou
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

D    219.146.2.0/24 [90/2681856] via 219.146.1.2, 00:09:49, Serial1/1
                    [90/2681856] via 219.146.0.2, 00:09:49, Serial1/0
D    219.146.3.0/24 [90/2681856] via 219.146.0.2, 00:09:48, Serial1/0
C    219.146.0.0/24 is directly connected, Serial1/0
C    219.146.1.0/24 is directly connected, Serial1/1


r2(config)#do sh ip rou
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

C    219.146.2.0/24 is directly connected, Serial1/0
D    219.146.3.0/24 [90/2681856] via 219.146.2.2, 00:10:18, Serial1/0
D    219.146.0.0/24 [90/2681856] via 219.146.2.2, 00:10:18, Serial1/0
                    [90/2681856] via 219.146.1.1, 00:10:18, Serial1/1
C    219.146.1.0/24 is directly connected, Serial1/1

这儿现已有等价的负载均衡,首要看一下R1和R2到R4的路由,从拓扑图来看,是有两条路由的,但这儿却只有一条,这是由于R1和R2到R4都没有FS(可行后继路由器),成为FS的条件是:AD<FD.AD是下一跳路由布告给本路由的布告间隔(个人理解为就是度量值)。FD是本路由抵达方针网络最优的可行间隔。这儿的AD是等于FD的,所以没有FS。能够检查一下:

r1(config)#do sh ip eigrp top all-links
IP-EIGRP Topology Table for AS(10)/ID(219.146.1.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 219.146.1.0/24, 1 successors, FD is 2169856, serno 2
        via Connected, Serial1/1
P 219.146.0.0/24, 1 successors, FD is 2169856, serno 1
        via Connected, Serial1/0
P 219.146.3.0/24, 1 successors, FD is 2681856, serno 5
        via 219.146.0.2 (2681856/2169856), Serial1/0
        via 219.146.1.2 (3193856/2681856), Serial1/1
P 219.146.2.0/24, 2 successors, FD is 2681856, serno 6
        via 219.146.0.2 (2681856/2169856), Serial1/0
        via 219.146.1.2 (2681856/2169856), Serial1/1


后边跟上all-links,能够检查一切链路。能够看出AD是等于FD的。只要让AD小于FD,那就完成了不等价负载均衡。怎样修正AD呢?

首要,要知道EIGRP度量值的算法:

EIGRP的度量值=K1*带宽+*(K2*带宽)/(256-负载)+K3*推迟。
由于默许K1和K3等于1.其他等于0.所以:
EIGRP的度量值=带宽+推迟
带宽=10的7次方/最低链路的带宽(单位为Kbit/s)*256
推迟=推迟(单位为10微秒.而用show interfaces显现的推迟是以微秒为单位的)的总和*256
所以终究度量值为:
EIGRP的度量值=(10的7次方/带宽(一切进口带宽最小值)+推迟的和(一切进口推迟的和)/10)*256

经过上面的公式。能够知道修正度量值能够修正K值,带宽,推迟。但一般不主张修正K值,带宽修正的核算杂乱,所以修正推迟最便利。

在这个拓扑中,能够修正R3的S1/2、R1的S1/0或许R3的S1/2、R2的S1/0、R1的S1/1。
但R1的S1/2会影响到这两条路由,所以不能修正。那么能够把R1的推迟改大或R2的推迟改小。

r1(config)#do sh int s1/0
Serial1/0 is up, line protocol is up
  Hardware is M4T
  Internet address is 219.146.0.1/24
  MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec

r1(config)#in s1/0
r1(config-if)#delay 2001 //推迟添加10,留意这儿不是20010(单位是10微秒)
r1(config-if)#exi

r1(config)#do sh ip rou
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

D    219.146.2.0/24 [90/2681856] via 219.146.1.2, 00:00:32, Serial1/1
D    219.146.3.0/24 [90/2682112] via 219.146.0.2, 00:00:32, Serial1/0
C    219.146.0.0/24 is directly connected, Serial1/0
C    219.146.1.0/24 is directly connected, Serial1/1

发现并没有完成负载均衡。并且方才那条等价的也没有了,由于现在是不等价了。

r1(config)#do sh ip pro
Routing Protocol is "eigrp 10"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 10
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    219.146.0.0/23
  Routing Information Sources:
    Gateway         Distance      Last Update
    219.146.1.2           90      00:03:04
    219.146.0.2           90      00:03:04
  Distance: internal 90 external 170

这儿的variance值是1.这就是仅仅等价的负载均衡。但现在是不等价的,一切没有路由。修正一下variance值。variance指的是倍数。是FD和AD的倍数。

r1(config)#router e 10
r1(config-router)#variance 2
r1(config-router)#exi

r1(config)#do sh ip rou
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

D    219.146.2.0/24 [90/2681856] via 219.146.1.2, 00:00:04, Serial1/1
                    [90/2682112] via 219.146.0.2, 00:00:04, Serial1/0
D    219.146.3.0/24 [90/3193856] via 219.146.1.2, 00:00:04, Serial1/1
                    [90/2682112] via 219.146.0.2, 00:00:04, Serial1/0
C    219.146.0.0/24 is directly connected, Serial1/0
C    219.146.1.0/24 is directly connected, Serial1/1

现在现已呈现了。并且是不等价的负载均衡。

现在怎样把方才那条(219.146.2.0)还原成等价的呢?当然修正推迟也能够抵达意图。这儿运用一种更简略的办法。偏移列表:

r1(config)#access-list 10 permit 219.146.2.0 0.0.0.255
r1(config)#router e 10
r1(config-router)#offset-list 10 in 256 serial 1/1
r1(config-router)#exi

r1(config)#do sh ip rou
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

D    219.146.2.0/24 [90/2682112] via 219.146.1.2, 00:00:06, Serial1/1
                    [90/2682112] via 219.146.0.2, 00:00:06, Serial1/0
D    219.146.3.0/24 [90/3193856] via 219.146.1.2, 00:10:17, Serial1/1
                    [90/2682112] via 219.146.0.2, 00:10:17, Serial1/0
C    219.146.0.0/24 is directly connected, Serial1/0
C    219.146.1.0/24 is directly connected, Serial1/1

现已完成了,一条等价一条不等价的。


持续检查一下负载均衡的流量分配情况。

r1(config)#do sh ip rou 219.146.3.0
Routing entry for 219.146.3.0/24
  Known via "eigrp 10", distance 90, metric 2682112, type internal
  Redistributing via eigrp 10
  Last update from 219.146.1.2 on Serial1/1, 00:07:24 ago
  Routing Descriptor Blocks:
    219.146.1.2, from 219.146.1.2, 00:07:24 ago, via Serial1/1
      Route metric is 3193856, traffic share count is 101
      Total delay is 60000 microseconds, minimum bandwidth is 1544 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 2
  * 219.146.0.2, from 219.146.0.2, 00:07:24 ago, via Serial1/0
      Route metric is 2682112, traffic share count is 120
      Total delay is 40010 microseconds, minimum bandwidth is 1544 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1


这儿的101和120指的是抵达方针网络的数据包从S1/1走101个,从S1/0走120.

来测验一下:在R3上做一个拜访列表:

r3(config)#ip access-list extended cs
r3(config-ext-nacl)#per ip host 219.146.0.1 host 219.146.3.2
r3(config-ext-nacl)#per ip host 219.146.1.1 host 219.146.3.2
r3(config-ext-nacl)#per ip any any
r3(config-ext-nacl)#exi
r3(config)#in s1/0
r3(config-if)#ip access-group cs in
r3(config-if)#in s1/1
r3(config-if)#ip access-group cs in
r3(config-if)#exi

r3(config)#do sh ip acce
Extended IP access list cs
    10 permit ip host 219.146.0.1 host 219.146.3.2
    20 permit ip host 219.146.1.1 host 219.146.3.2
    30 permit ip any any (42 matches)

现在匹配的都为0,在R1上运用扩展ping一下:

r1#ping
*Jan  2 13:20:14.739: %SYS-5-CONFIG_I: Configured from console by console
r1#ping
Protocol [ip]:
Target IP address: 219.146.3.2
Repeat count [5]: 663
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 663, 100-byte ICMP Echos to 219.146.3.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (663/663), round-trip min/avg/max = 12/88/220 ms


r3(config)#do sh ip acce
Extended IP access list cs
    10 permit ip host 219.146.0.1 host 219.146.3.2 (663 matches)
    20 permit ip host 219.146.1.1 host 219.146.3.2
    30 permit ip any any (174 matches)

发现并没有完成负载均衡,一切数据都走了最好的那条路由。(不要以为路由表中显现负载均衡就一定会负载均衡)这是由于还有一个思科的快速转宣布。在R1上封闭后再试。

r1#conf t
r1(config)#no ip cef
r1(config)#exi

清空一下R3方才的记载:

r3(config)#exi
r3#clear ip access-list counters
r3#sh ip acce
Extended IP access list cs
    10 permit ip host 219.146.0.1 host 219.146.3.2
    20 permit ip host 219.146.1.1 host 219.146.3.2
    30 permit ip any any (28 matches)

r1#ping
Protocol [ip]:
Target IP address: 219.146.3.2
Repeat count [5]: 663
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 663, 100-byte ICMP Echos to 219.146.3.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (663/663), round-trip min/avg/max = 12/73/176 ms


r3#sh ip acce
Extended IP access list cs
    10 permit ip host 219.146.0.1 host 219.146.3.2 (360 matches)
    20 permit ip host 219.146.1.1 host 219.146.3.2 (303 matches)
    30 permit ip any any (74 matches)

现在现已真实完成了不等价的负载均衡。

接下来看一下流量操控:
r1#conf t
r1(config)#router e 10
r1(config-router)#traffic-share min across-interfaces //运用最小开支的路由转发数据
r1(config-router)#end

r3#clear ip access-list coun


r1#ping
Protocol [ip]:
Target IP address: 219.146.3.2
Repeat count [5]: 663
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 663, 100-byte ICMP Echos to 219.146.3.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (663/663), round-trip min/avg/max = 12/65/148 ms


r3#sh ip acce
Extended IP access list cs
    10 permit ip host 219.146.0.1 host 219.146.3.2 (663 matches)
    20 permit ip host 219.146.1.1 host 219.146.3.2
    30 permit ip any any (84 matches)

这儿现已只从最小开支的链路转发数据了。但路由表中仍是显现不等价负载均衡的。

r1#sh ip rou
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

D    219.146.2.0/24 [90/2681856] via 219.146.1.2, 00:12:54, Serial1/1
                    [90/2682112] via 219.146.0.2, 00:12:54, Serial1/0
D    219.146.3.0/24 [90/3193856] via 219.146.1.2, 00:12:54, Serial1/1
                    [90/2682112] via 219.146.0.2, 00:12:54, Serial1/0
C    219.146.0.0/24 is directly connected, Serial1/0
C    219.146.1.0/24 is directly connected, Serial1/1

这就再次说明晰不要看到路由表显现负载均衡就以为真实的完成了负载均衡。

EIGRP的不等价负载均衡就先到这儿。
 

版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表威尼斯人立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章