EIGRP简介

实验拓扑

image-20200315090302472

配置IP地址,在每个路由器上配置一个loopback接口

1

配置EIGRP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
R1(config)#router eigrp 100
R1(config-router)#network 1.0.0.0
R1(config-router)#network 192.168.12.0
==========================================
R2(config)#router eigrp 100
R2(config-router)#network 2.0.0.0
R2(config-router)#network 192.168.12.0
R2(config-router)#network
R2(config-router)#network 192.168.23.0
============================================
R3(config)#router eigrp 100
R3(config-router)#network 3.0.0.0
R3(config-router)#network 192.168.23.0
R3(config-router)#network 192.168.34.0
==========================================
R4(config)#router eigrp 100
R4(config-router)#network 4.0.0.0
R4(config-router)#network 192.168.34.0

EIGRP的三张表

邻居表

当EIGRP启动之后,会向相邻的设备发送hello消息,使用的组播224.0.0.10

hello消息在计算机技术中,经常用于存活确认,所以也被称为心跳消息。

相邻设备收到hello消息之后就会将发送方作为自己的邻居

通过如下方式检查:

1
2
3
4
5
6
R2#sh ip eigrp neighbors 
EIGRP-IPv4 Neighbors for AS(100)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
1 192.168.23.3 Et0/1 12 00:04:48 3 100 0 7
0 192.168.12.1 Et0/0 11 00:05:28 9 100 0 7

H:编号

Address:邻居地址

Interface:建立邻居的接口

Hold:一个计时器,15s开始倒计时,倒计时到0,这个邻居就被删了,正常情况下每5s收到hello消息的时候就重置。

Uptime:邻居关系建立的时间

SRTT:平均往返延迟,取最近几次数据往返的延迟。用于数据丢包的时候,最长需要等待多久重传。

RTO:重传间隔

Q cnt:重传队列,当发生丢包的时候,重传的数据会在这个队列中等待。正常情况下是0

Seq Num:这个邻居给我发的路由消息数量

拓扑表

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
R2#show ip eigrp topology 
EIGRP-IPv4 Topology Table for AS(100)/ID(2.2.2.2)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status

P 192.168.23.0/24, 1 successors, FD is 281600
via Connected, Ethernet0/1
P 192.168.34.0/24, 1 successors, FD is 307200
via 192.168.23.3 (307200/281600), Ethernet0/1
P 192.168.12.0/24, 1 successors, FD is 281600
via Connected, Ethernet0/0
P 2.2.2.0/24, 1 successors, FD is 128256
via Connected, Loopback0
P 3.3.3.0/24, 1 successors, FD is 409600
via 192.168.23.3 (409600/128256), Ethernet0/1
P 1.1.1.0/24, 1 successors, FD is 409600
via 192.168.12.1 (409600/128256), Ethernet0/0
P 4.4.4.0/24, 1 successors, FD is 435200
via 192.168.23.3 (435200/409600), Ethernet0/1

名词解释

DUAL: 是 EIGRP确定最佳无环路径和无环备用路径的方法

DUAL使用几个术语

  • 后继路由器

    • 下一跳路由器
  • 可行距离(FD)

    • 度量值,EIGRP衡量一条线路的好坏使用到线路的5个数值
      • MTU:bytes
        • 最大传输单元,也就是分段的最大大小
        • 默认是1500
      • 带宽:越大越好,Kbit/sec
      • 延迟:usec
      • 可靠性:255/255
      • 负载:1/255
    • 度量值计算方法
      • image-20200315095351605
      • 其中K1-5是用来控制公式的,比如我要忽略可靠性的影响,可以把K5设置为0
      • 默认情况下,K1和K3是1,其他的K值都是0.
      • 所以通常情况下,度量值=256×(10^7/最小带宽+累积延时/10)
  • 可行后继路由器(FS)

    • 可以理解为后继路由器的备胎,EIGRP会探测各种能去往目的地的可能路线,即使不是最佳,也会放到拓扑表中,成为备份。
  • 报告距离(RD),或称通告距离(AD)

    • 路由条目下一跳到达目的地的度量值,也就是EIGRP邻居到达目的地的度量值。
  • 可行条件,或称可行性条件(FC)

    • AD<FD满足这个条件的路由,才会成为备胎

拓扑表中存放着EIGRP通过DUAL算法得到的无环路路线,只有最佳路线会进入路由表,其他的会作为备份线路存在。

EIGRP路由表

1
2
3
4
5
6
7
8
R2#show ip route eigrp
1.0.0.0/24 is subnetted, 1 subnets
D 1.1.1.0 [90/409600] via 192.168.12.1, 00:02:16, Ethernet0/0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/409600] via 192.168.23.3, 00:02:16, Ethernet0/1
4.0.0.0/24 is subnetted, 1 subnets
D 4.4.4.0 [90/435200] via 192.168.23.3, 00:02:14, Ethernet0/1
D 192.168.34.0/24 [90/307200] via 192.168.23.3, 00:02:16, Ethernet0/1
  • EIGRP的管理距离有三个
    • 5 EIGRP的汇总路由
    • 90 EIGRP的内部路由
    • 170 EIGRP的外部路由

EIGRP的工作细节

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
R2#show ip protocols 
Routing Protocol is "eigrp 100"
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-IPv4 Protocol for AS(100)
Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
Soft SIA disabled
NSF-aware route hold timer is 240
Router-ID: 2.2.2.2
Topology : 0 (base)
Active Timer: 3 min
Distance: internal 90 external 170
Maximum path: 4
Maximum hopcount 100
Maximum metric variance 1

Automatic Summarization: disabled
Maximum path: 4
Routing for Networks:
2.0.0.0
192.168.12.0
192.168.23.0
Routing Information Sources:
Gateway Distance Last Update
192.168.12.1 90 00:05:09
192.168.23.3 90 00:05:09
Distance: internal 90 external 170
  • EIGRP最大跳数默认是100跳

  • 默认自动汇总是关闭的

  • 最大等价负载均衡是4

  • EIGRP是触发更新,路由表不发生变化就不会更新条目,仅仅靠hello消息维持关系

  • EIGRP是5s发送一次hello,15s没收到,就删除邻居,以及邻居学到的所有路由

EIGRP的查询机制

EIGRP路由表中某条路由消失了并且没有备用路线,会触发EIGRP查询,EIGRP会向所有的邻居查询这条路由是否存在。

如果邻居也没有这个路由,那么邻居会向邻居的邻居查找,这么一路找下来都没有,那么这条路由就会被删除。

由于EIGRP等邻居回应最多180s,如果180s邻居都没回应查询,就回把邻居删除,这种情况被称为SIA(stuck in active)

下面3个原因会导致SIA的发生

  1. 路由器太忙无法回答查询,CPU过高或是内存不够
  2. 路由器之间的链路问题,出现丢包.
  3. 单向链路

如果是hub-spoke拓扑

img

我们可以设置spoke设备为eigrp stub,这样spoke设备就只能收到汇总的路由,并且不会被查询

EIGRP汇总路由

在R1上配置3个lo接口,并且宣告进eigrp

1
2
3
4
5
6
7
8
9
R1
int lo1
ip add 172.16.1.1 255.255.255.0
int lo2
ip add 172.16.2.1 255.255.255.0
int lo3
ip add 172.16.3.1 255.255.255.0
router eigrp 100
network 172.16.0.0

我们在R2的路由更新出口上进行汇总

1
2
interface Ethernet0/1
ip summary-address eigrp 100 172.16.0.0 255.255.0.0

在R4上进行查看

1
2
3
R4#show ip route
172.16.0.0/16 is subnetted, 1 subnets
D 172.16.0.0 [90/460800] via 192.168.34.3, 00:00:34, Ethernet0/0

默认路由

可以在接口上汇总出一个默认路由

1
2
interface Ethernet0/0
ip summary-address eigrp 100 0.0.0.0 0.0.0.0

路由认证

EIGRP只支持MD5认证

1
2
3
interface Ethernet0/0
ip authentication mode eigrp 100 md5
ip authentication key-chain eigrp 100 cisco

负载均衡

实验拓扑

image-20200315104854982

现在R1去往R3就有两条路线可以去

配置EIGRP

1

查看R1的路由表

1
2
3
4
R1#sh ip route eigrp
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/435200] via 192.168.14.4, 00:00:08, Ethernet0/1
[90/435200] via 192.168.12.2, 00:00:08, Ethernet0/0

我们发现R1去往R3的3.3.3.0/24有两个下一跳,说明是负载均衡,然后我发现两个下一跳的度量值都是435200说明是等价负载均衡,表示数据会一个下一跳发一个。

为了实现非等价负载均衡,我们修改带宽或者延迟。

1
2
3
R2
interface Ethernet0/1
delay 90

再次查看R1的路由表

1
2
3
R1#sh ip route eigrp
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/432640] via 192.168.12.2, 00:00:22, Ethernet0/0

查看R1的拓扑表,发现另外另外一条线路变成了备用线路

1
2
3
4
R1#show ip eigrp topology 
P 3.3.3.0/24, 1 successors, FD is 432640
via 192.168.12.2 (432640/176640), Ethernet0/0
via 192.168.14.4 (435200/409600), Ethernet0/1

我们可以计算备用线路和在用线路度量值的比值

435200÷432640=1.0059171597633136

超过1,就进1的做法,我们算出他们的比例≈2

可以将eigrp的负载均衡比例调整为2,默认是1。

调整之后备用线路的度量值和最佳线路的度量值比例低于2的,都可以加入负载均衡

1
2
R1(config)#router eigrp 100
R1(config-router)#variance 2

然后我们查看路由表

1
2
3
4
R1#sh ip route eigrp
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/435200] via 192.168.14.4, 00:00:23, Ethernet0/1
[90/432640] via 192.168.12.2, 00:00:23, Ethernet0/0

查看负载均衡的比例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
R1#show ip route 3.3.3.0
Routing entry for 3.3.3.0/24
Known via "eigrp 100", distance 90, metric 432640, type internal
Redistributing via eigrp 100
Last update from 192.168.14.4 on Ethernet0/1, 00:00:53 ago
Routing Descriptor Blocks:
192.168.14.4, from 192.168.14.4, 00:00:53 ago, via Ethernet0/1
Route metric is 435200, traffic share count is 239
Total delay is 7000 microseconds, minimum bandwidth is 10000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 2
* 192.168.12.2, from 192.168.12.2, 00:00:53 ago, via Ethernet0/0
Route metric is 432640, traffic share count is 240
Total delay is 6900 microseconds, minimum bandwidth is 10000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 2

可以看到这两条线路的负载比例是239:240,也就是一条线路走239个数据,另外一条走240个数据。

评论
加载中,最新评论有1分钟缓存...