实验20: EIGRP 负载均衡
1.
实验目的
通过本实验可以掌握:
(1)EIGRP 等价负载均衡的实现方法
(2)
修改EIGRP 度量值的方法
(4)可行距离(FD)、通告距离(AD)以及可行性条件(FC)的深层含义
后继:是一个直接连接的邻居路由器,通过它到达目的网络的路由最优;
可行后继:是一个邻居路由器,但是通过它到达目的地的度量值比其它路由器高,但它
的通告距离小于通过后继路由器到达目的网络的可行距离,因而被保存在拓扑表中,用做备
份路由。
EIGRP
非等价负载均衡是通过“variance”命令实现的, “variance”默认是1(即代
表等价路径的负载均衡), variance 值的范围是1-128.这个参数代表了可以接受的不等价路
径的度量值的倍数,在这个范围内的链路都将被接受,并且被放入路由表中。
2.
实验拓扑
本实验拓扑结构如图所示。
EIGRP 负载均衡
3.
实验步骤:配置如下
r0(config)#no ip domain loo
r0(config)#lin c 0
r0(config-line)#logg s
r0(config-line)#exec-t 00
r0(config-line)#exit
r0(config)#int s0/0
r0(config-if)#ip add 172.16.1.1 255.255.255.0
r0(config-if)#no sh
r0(config-if)#
*Mar 1 00:07:21.351: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
*Mar 1 00:07:22.351: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r0(config-if)#exit
r0(config)#int loo 1
r0(config-if)#ip add
*Mar 1 00:07:31.479: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
r0(config-if)#ip add 4.4.4 .4 255.255.255.0
r0(config-if)#no sh
r0(config-if)#int s
*Mar 1 00:07:43.363: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
r0(config-if)#int s0/3
r0(config-if)#ip add 172.16.4.1 255.255.255.0
r0(config-if)#no sh
r0(config-if)#
*Mar 1 00:08:20.251: %LINK-3-UPDOWN: Interface Serial0/3, changed state to up
*Mar 1 00:08:21.251: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3, changed state to up
r0(config-if)#
*Mar 1 00:08:43.495: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3, changed state to down
r0(config-if)#
*Mar 1 00:08:53.347: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r0(config-if)#
*Mar 1 00:10:23.479: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3, changed state to up
r0(config-if)#exit
r0(config)#router eigrp 1
r0(config-router)#net 4.4.4 .0 0.0.0.255
r0(config-router)#net 172.16.4.0 0.0.0 .255
r0(config-router)#net
*Mar 1 00:13:22.979: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.4.2 (Serial0/3) is up: new adjacency
r0(config-router)#net 172.16.1.0 0.0.0 .255
r0(config-router)#
*Mar 1 00:13:48.571: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.1.2 (Serial0/0) is up: new adjacency
r0(config-router)#do wr
Building configuration...
[OK]
r0(config-router)#do sh ip route
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
1.0.0 .0/24 is subnetted, 1 subnets
D 1.1.1 .0 [90/2809856] via 172.16.4.2, 00:03:15, Serial0/3
[90/2809856] via 172.16.1.2, 00:03:15, Serial0/0
4.0.0 .0/8 is variably subnetted, 2 subnets, 2 masks
C 4.4.4 .0/24 is directly connected, Loopback1
D 4.0.0 .0/8 is a summary, 00:03:55, Null0
172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
C 172.16.4.0/24 is directly connected, Serial0/3
D 172.16.0.0/16 is a summary, 00:03:55, Null0
C 172.16.1.0/24 is directly connected, Serial0/0
D 172.16.2.0/24 [90/2681856] via 172.16.1.2, 00:03:15, Serial0/0
D 172.16.3.0/24 [90/2681856] via 172.16.4.2, 00:03:15, Serial0/3
0(config)#
以上输出表明路由条目“ 1.1.1 .1”确实有两条等价路径,表明EIGRP 是支持等价负载
r0(config)#do sh ip route eigrp
1.0.0 .0/24 is subnetted, 1 subnets
D 1.1.1 .0 [90/2809856] via 172.16.4.2, 00:08:47, Serial0/3
[90/2809856] via 172.16.1.2, 00:08:47, Serial0/0
4.0.0 .0/8 is variably subnetted, 2 subnets, 2 masks
D 4.0.0 .0/8 is a summary, 00:09:27, Null0
172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
D 172.16.0.0/16 is a summary, 00:09:27, Null0
D 172.16.2.0/24 [90/2681856] via 172.16.1.2, 00:08:47, Serial0/0
D 172.16.3.0/24 [90/2681856] via 172.16.4.2, 00:08:47, Serial0/3
r0(config)#
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho r1
r1(config)#no ip do loo
r1(config)#lin c 0
r1(config-line)#logg s
r1(config-line)#exec-t 00
r1(config-line)#exit
r1(config)#int s0/0
r1(config-if)#ip add 172.16.1.2 255.255.255.0
r1(config-if)#no sh
r1(config-if)#exit
r1(config)#itn s
*Mar 1 00:08:44.883: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
*Mar 1 00:08:45.883: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r1(config)#int s0/1
r1(config-if)#ip add 172.16.2.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#
*Mar 1 00:09:01.075: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up
*Mar 1 00:09:02.075: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up
r1(config-if)#
*Mar 1 00:09:22.923: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down
r1(config-if)#
*Mar 1 00:09:32.911: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up
r1(config-if)#exit
r1(config)#router eigrp 1
r1(config-router)#net 172.16.1.0 0.0.0 .255
r1(config-router)#net 172
*Mar 1 00:13:48.259: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.1.1 (Serial0/0) is up: new adjacency
r1(config-router)#net 172.16.2.0 0.0.0 .2555
^
% Invalid input detected at '^' marker.
r1(config-router)#net 172.16.2.0 0.0.0 .255
r1(config-router)#
*Mar 1 00:14:02.431: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.2.2 (Serial0/1) is up: new adjacency
r1(config-router)#do sh ip int b
Interface IP-Address OK? Method Status Protocol
Serial0/0 172.16.1.2 YES manual up up
Serial0/1 172.16.2.1 YES manual up up
Serial0/2 unassigned YES unset administratively down down
Serial0/3 unassigned YES unset administratively down down
r1(config-router)#do wr
Building configuration...
[OK]
r1(config-router)#
r1(config-router)#
r1(config-router)#
r1(config-router)#do sh ip route eigrp
1.0.0 .0/24 is subnetted, 1 subnets
D 1.1.1 .0 [90/2297856] via 172.16.2.2, 00:09:10, Serial0/1
D 4.0.0 .0/8 [90/2297856] via 172.16.1.1, 00:09:10, Serial0/0
172.16.0.0/24 is subnetted, 4 subnets
D 172.16.4.0 [90/2681856] via 172.16.1.1, 00:09:11, Serial0/0
D 172.16.3.0 [90/2681856] via 172.16.2.2, 00:09:11, Serial0/1
r1(config-router)#
Router(config)#ho r2
r2(config)#no ip dom loo
r2(config)#lin c 0
r2(config-line)#logg s
r2(config-line)#exec-t 00
r2(config-line)#exit
r2(config)#int s0/1
r2(config-if)#ip add 172.16.2.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#
*Mar 1 00:09:16.871: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up
*Mar 1 00:09:17.871: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up
r2(config-if)#exit
r2(config)#int s0/2
r2(config-if)#ip add 172.16.3.1 255.255.255.0
r2(config-if)#no sh
r2(config-if)#exit
r2(config)#router
*Mar 1 00:10:37.911: %LINK-3-UPDOWN: Interface Serial0/2, changed state to up
*Mar 1 00:10:38.911: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/2, changed state to up
r2(config)#router eigrp 1
r2(config-router)#exit
r2(config)#int loo 1
r2(config-if)#ip a
*Mar 1 00:11:07.579: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
r2(config-if)#ip add 1.1.1 .1 255.255.255.0
r2(config-if)#exit
r2(config)#router eigrp 1
r2(config-router)#net 1.1.1 .0 0.0.0.255
r2(config-router)#net 172.16.2.0 0.0.0 .255
r2(config-router)#net 172.16.3.0
r2(config-router)#no net 172.16.3.0
r2(config-router)#net 172.16.3.0 0.0.0 .255
r2(config-router)#no au
r2(config-router)#
*Mar 1 00:12:35.971: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.3.2 (Serial0/2) is up: new adjacency
r2(config-router)#
*Mar 1 00:14:02.083: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.2.1 (Serial0/1) is up: new adjacency
r2(config-router)#do sh ip int b
Interface IP-Address OK? Method Status Protocol
Serial0/0 unassigned YES unset administratively down down
Serial0/1 172.16.2.2 YES manual up up
Serial0/2 172.16.3.1 YES manual up up
Serial0/3 unassigned YES unset administratively down down
Loopback1 1.1.1 .1 YES manual up up
r2(config-router)#do wr
Building configuration...
[OK]
r2(config-router)#do ping 4.4.4 .4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4 .4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/28/64 ms
r2(config-router)#do sh ip eigrp 1
sh ip eigrp 1
% Incomplete command.
r2(config-router)#do sh ip eigrp
sh ip eigrp
% Incomplete command.
r2(config-router)#do sh ip eigrp 1
sh ip eigrp 1
% Incomplete command.
r2(config-router)#do sh ip route
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
1.0.0 .0/24 is subnetted, 1 subnets
C 1.1.1 .0 is directly connected, Loopback1
D 4.0.0 .0/8 [90/2809856] via 172.16.3.2, 00:01:41, Serial0/2
[90/2809856] via 172.16.2.1, 00:01:41, Serial0/1
172.16.0.0/24 is subnetted, 4 subnets
D 172.16.4.0 [90/2681856] via 172.16.3.2, 00:01:41, Serial0/2
D 172.16.1.0 [90/2681856] via 172.16.2.1, 00:01:41, Serial0/1
C 172.16.2.0 is directly connected, Serial0/1
C 172.16.3.0 is directly connected, Serial0/2
r2(config-router)#do sh ip eigrp nei
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
1 172.16.2.1 Se0/1 12 00:01:47 94 564 0 11
0 172.16.3.2 Se0/2 13 00:03:14 96 576 0 11
r2(config-router)#do sh ip protoco
Routing Protocol is "eigrp 1"
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 1
EIGRP NSF-aware route hold timer is 240s
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
1.1.1 .0/24
172.16.2.0/24
172.16.3.0/24
Routing Information Sources:
Gateway Distance Last Update
(this router) 90 00:04:12
172.16.3.2 90 00:01:56
172.16.2.1 90 00:01:56
Distance: internal 90 external 170
r2(config-router)#
r2(config-router)#do sh ip route eigrp
D 4.0.0 .0/8 [90/2809856] via 172.16.3.2, 00:09:23, Serial0/2
[90/2809856] via 172.16.2.1, 00:09:23, Serial0/1
172.16.0.0/24 is subnetted, 4 subnets
D 172.16.4.0 [90/2681856] via 172.16.3.2, 00:09:23, Serial0/2
D 172.16.1.0 [90/2681856] via 172.16.2.1, 00:09:23, Serial0/1
r2(config-router)#
r3(config)#no ip dom loo
r3(config)#lin c 0
r3(config-line)#logg s
r3(config-line)#exec-t 00
r3(config-line)#exit
r3(config)#int s0/2
r3(config-if)#ip add 172.16.3.2 255.255.255.0
r3(config-if)#no sh
r3(config-if)#exit
r3(config)#int s
*Mar 1 00:09:50.587: %LINK-3-UPDOWN: Interface Serial0/2, changed state to up
*Mar 1 00:09:51.587: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/2, changed state to up
r3(config)#int s0/3
r3(config-if)#ip add 172.16.4.2 255.255.255.0
r3(config-if)#no sh
r3(config-if)#
*Mar 1 00:10:09.403: %LINK-3-UPDOWN: Interface Serial0/3, changed state to up
*Mar 1 00:10:10.403: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3, changed state to up
r3(config-if)#
*Mar 1 00:10:13.127: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/2, changed state to down
r3(config-if)#
*Mar 1 00:10:53.111: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/2, changed state to up
r3(config-if)#exit
r3(config)#router eigrp 1
r3(config-router)#no au
r3(config-router)#net 172.16.3.0 0.0.0 .255
r3(config-router)#net 17
*Mar 1 00:12:35.715: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.3.1 (Serial0/2) is up: new adjacency
r3(config-router)#net 172.16.4.0 0.0.0 .255
r3(config-router)#
*Mar 1 00:13:21.935: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 172.16.4.1 (Serial0/3) is up: new adjacency
r3(config-router)#do sh ip int b
Interface IP-Address OK? Method Status Protocol
Serial0/0 unassigned YES unset administratively down down
Serial0/1 unassigned YES unset administratively down down
Serial0/2 172.16.3.2 YES manual up up
Serial0/3 172.16.4.2 YES manual up up
r3(config-router)#do wr
Building configuration...
[OK]
r3(config-router)#
r3(config)#int s0/3
r3(config-if)#delay 2000
r3(config-if)#do sh ip route eigrp
1.0.0 .0/24 is subnetted, 1 subnets
D 1.1.1 .0 [90/2297856] via 172.16.3.1, 00:01:11, Serial0/2
D 4.0.0 .0/8 [90/2297856] via 172.16.4.1, 00:01:11, Serial0/3
172.16.0.0/24 is subnetted, 4 subnets
D 172.16.1.0 [90/2681856] via 172.16.4.1, 00:01:11, Serial0/3
D 172.16.2.0 [90/2681856] via 172.16.3.1, 00:01:11, Serial0/2
r3(config-if)#
本文出自 “柯浩坚” 博客,转载请与作者联系!