24
第24篇:EIGRP非等价负载均衡
上一节我们学习了EIGRP基础实验,今天我们开始学习EIGRP非等价负载均衡,跟着我一起往下看吧。
配置EIGRP实验
说明:实验配置共包含:
EIGRP基础实验
EIGRP非等价负载均衡
EIGRP Stub
EIGRP手工汇总
EIGRP认证
EIGRP默认路由
基于上节的基础实验配置,本节我们延续上节的实验环境进一步学习EIGRP的非等价负载均衡。
4.测试EIGRP非等价负载均衡
(1)查看R1到目标4.4.4.4的RD:
r1#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(13.1.1.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 4.4.4.0/24, 1 successors, FD is 158720
via 12.1.1.2 (158720/156160), FastEthernet0/1
P 12.1.1.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/1
P 13.1.1.0/24, 1 successors, FD is 2562560
via Connected, FastEthernet0/0
via 12.1.1.2 (2177536/2174976), FastEthernet0/1
P 24.1.1.0/24, 1 successors, FD is 30720
via 12.1.1.2 (30720/28160), FastEthernet0/1
P 34.1.1.0/24, 1 successors, FD is 2174976
via 12.1.1.2 (2174976/2172416), FastEthernet0/1
via 13.1.1.3 (3074560/2169856), FastEthernet0/0
r1#
说明:因为R1与R2是EIGRP邻居,R2将路由信息发给R1之后,R2到目标4.4.4.4的Metric值156160就成为了R1到目标4.4.4.4的RD值,而当前R1到目标4.4.4.4的FD为158720,这条信息将被放入路由表中使用;拓朴数据库中显示确实如此;而拓朴数据库中为什么没有R1经过R3到目标4.4.4.4的路径,下面来查看:
(2)查看R1经过R3到目标4.4.4.4的路径:
说明:R1经过R3到目标4.4.4.4的路径不能存放于拓朴数据库中,应该是不满足FC的条件(R3到目标4.4.4.4的Metric值必须小于R1当前的FD值158720)
所以,我们手工计算R3到目标4.4.4.4的Metric值
查看带宽与延迟:
r4#sh interfaces loopback 0
Loopback0 is up, line protocol is up
Hardware is Loopback
Internet address is 4.4.4.4/24
MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,
r3#sh int s1/0
Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is 34.1.1.3/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec
R3到4.4.4.4链路中的最小带宽为1544 Kbit,延迟之和为20000 usec +5000 usec=25000 usec
应用到公式中为:
(1000 0000/1544 +25000/10)×256
↓
(6476.6 + 2500)×256=2297856
说明:所以很明显,R3到目标4.4.4.4的Metric值必须小2297856大于R1当前的FD值158720,所以无法存放于拓朴数据库中,所以当前R1只使用经过R2到目标4.4.4.4的路径,如下:
r1#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
34.0.0.0/24 is subnetted, 1 subnets
D 34.1.1.0 [90/2174976] via 12.1.1.2, 00:07:46, FastEthernet0/1
4.0.0.0/24 is subnetted, 1 subnets
D 4.4.4.0 [90/158720] via 12.1.1.2, 00:15:36, FastEthernet0/1
24.0.0.0/24 is subnetted, 1 subnets
D 24.1.1.0 [90/30720] via 12.1.1.2, 00:19:50, FastEthernet0/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/1
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, FastEthernet0/0
r1#
★查看R3到目标4.4.4.4的路径:
r3#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
34.0.0.0/24 is subnetted, 1 subnets
C 34.1.1.0 is directly connected, Serial1/0
4.0.0.0/24 is subnetted, 1 subnets
D 4.4.4.0 [90/161280] via 13.1.1.1, 00:13:15, FastEthernet0/0
24.0.0.0/24 is subnetted, 1 subnets
D 24.1.1.0 [90/33280] via 13.1.1.1, 00:13:15, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/30720] via 13.1.1.1, 00:13:15, FastEthernet0/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, FastEthernet0/0
r3#
说明:由于R3从S1/0到目标4.4.4.4的Metric值太大,所以R3自己都没从S1/0到4.4.4.4,而选择从R1到4.4.4.4。
(3)计算R3成为R1到目标4.4.4.4的FS的条件:
因为R1当前的FD为158720,所以R3到目标4.4.4.4的Metric值必须小于158720,才能成为FS,因为R3的出口S1/0为帧中继接口,带宽实在太低,即使没有延迟,也不能成为FS,所以我们事先将接口带宽改为100 000 Kbit/s,从而再修改延迟到相应值,延迟需要改成多少,需要将公式进行反运算:
公式为:
R4 loopback 0的延迟为5000 usec,设置总延迟为X,则:
(1000 0000 / 100 000 + X)× 256 = 158720
↓
(100 + X)=158720 /256
↓
(100 + X)= 620
↓
X=520
所以R3成为R1到目标4.4.4.4的FS的条件的总延迟必须小于520,等于520也不行,
因为延迟除以10得到520,所以原始延迟为5200,而R4 loopback 0的延迟为5000 usec,得R3 S1/0的延迟为200,为了取小一点的值,我们取190,下面配置R3 S1/0的接口延迟为190:
r3(config)#int s1/0
r3(config-if)#delay 19
说明:在配置时,会自动乘以10,所以要配置190,就配置19。
(4)查看R3修改接口延迟后的情况:
r3#sh int s1/0
Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is 34.1.1.3/24
MTU 1500 bytes, BW 100000 Kbit, DLY 190 usec,
说明:延迟已经改成预计的190了。
(5)查看R3到目标4.4.4.4的情况:
r3#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
34.0.0.0/24 is subnetted, 1 subnets
C 34.1.1.0 is directly connected, Serial1/0
4.0.0.0/24 is subnetted, 1 subnets
D 4.4.4.0 [90/158464] via 34.1.1.4, 00:00:53, Serial1/0
24.0.0.0/24 is subnetted, 1 subnets
D 24.1.1.0 [90/33024] via 34.1.1.4, 00:00:53, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/30720] via 13.1.1.1, 00:00:53, FastEthernet0/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, FastEthernet0/0
r3#
说明:R3已经选择从S1/0到4.4.4.4,说明改动有效果。
(6)查看R1拓朴数据库中到目标4.4.4.4的情况:
r1#sh ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(13.1.1.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 4.4.4.0/24, 1 successors, FD is 158720
via 12.1.1.2 (158720/156160), FastEthernet0/1
via 13.1.1.3 (161024/158464), FastEthernet0/0
P 12.1.1.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/1
P 13.1.1.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 24.1.1.0/24, 1 successors, FD is 30720
via 12.1.1.2 (30720/28160), FastEthernet0/1
P 34.1.1.0/24, 1 successors, FD is 33024
via 13.1.1.3 (33024/30464), FastEthernet0/0
r1#
说明:R1当前的拓朴数据库中同时存在R2和R3到达目标4.4.4.4,并且显示经过R2的路径为FD,值为158720,而经过R3的Metric为161024,明显比FD大,但很微小。
(7)通过修改variance值使R1到目标4.4.4.4执行非等价负载均衡
r1(config)#router eigrp 1
r1(config-router)#variance 2
说明:因为当前FD为158720,要包含161024,只需要将FD为158720扩大2倍即可,值为158720×2=317440。
(8)查看R1负载均衡路由表:
r1#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
34.0.0.0/24 is subnetted, 1 subnets
D 34.1.1.0 [90/33024] via 13.1.1.3, 00:00:21, FastEthernet0/0
4.0.0.0/24 is subnetted, 1 subnets
D 4.4.4.0 [90/161024] via 13.1.1.3, 00:00:21, FastEthernet0/0
[90/158720] via 12.1.1.2, 00:00:21, FastEthernet0/1
24.0.0.0/24 is subnetted, 1 subnets
D 24.1.1.0 [90/30720] via 12.1.1.2, 00:00:21, FastEthernet0/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/1
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, FastEthernet0/0
r1#
说明:R1已经执行到4.4.4.4的负载均衡。
(9)测试负载均衡:
r1#traceroute 4.4.4.4
Type escape sequence to abort.
Tracing the route to 4.4.4.4
1 13.1.1.3 92 msec
12.1.1.2 144 msec
13.1.1.3 156 msec
2 24.1.1.4 92 msec
34.1.1.4 112 msec *
r1#
说明:R1已经执行到4.4.4.4的负载均衡。
(10)查看邻居发送的路由条目:
说明:当EIGRP用于复杂大型网络时,有时需要查看从邻居收到的路由条目情况。
r1#sh ip eigrp 1 accounting
IP-EIGRP accounting for AS(1)/ID(13.1.1.1)
Total Prefix Count: 5 States: A-Adjacency, P-Pending, D-Down
State Address/Source Interface Prefix Restart Restart/
Count Count Reset(s)
A 13.1.1.3 Fa0/0 3 0 0
A 12.1.1.2 Fa0/1 2 0 0
r1#
说明:R1从13.1.1.3(R3)收到3条,从12.1.1.2(R2)收到2条。
好了,今天这15分钟也完成了,建议线下动手做下实验,下一节我们将学习EIGRP Stub
领取专属 10元无门槛券
私享最新 技术干货