一个非本协议的路由条目引入本协议进行通告,叫做路由重分发。
如果IGRP路由条目要在EIGRP中做路由重分发,只需要将它的度量值乘以256,就可以得到EIGRP重
分发的度量值。反之,则除以256。
拓扑图:
EIGRP进程中的默认路由的注入:
一、
1、配置基本IP地址和路由协议,并保证路由的可通行
2、配置R2
ip route 0.0.0.0 0.0.0.0 f0/1 12.1.1.1
router eigrp 90
redistibute static
3、查看R3上是否获取该默认路由条目,命令:show ip route
Gateway of last resort is 23.1.1.2 to network 0.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/409600] via 23.1.1.2, 00:00:43, FastEthernet0/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet0/1
D*EX 0.0.0.0/0 [170/307200] via 23.1.1.2, 00:00:43, FastEthernet0/1
看了一个形如D*EX的默认路由,管理距离170,因为它是将默认路由条在EIGRP进程进行了
重分发,也就是外部引入路由。
二、
1、如上
2、R2上的配置
ip route 0.0.0.0 0.0.0.0 f0/1 看清楚了,不要填写下一跳IP地址
router eigrp 90
network 0.0.0.0 默认是将直连路由、只有退出接口的静态路由宣告进EIGRP进程
3、查看R3上的配置
Gateway of last resort is 23.1.1.2 to network 0.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/409600] via 23.1.1.2, 00:08:46, FastEthernet0/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet0/1
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/307200] via 23.1.1.2, 00:00:07, FastEthernet0/1
D* 0.0.0.0/0 [90/307200] via 23.1.1.2, 00:00:07, FastEthernet0/1
看到了吧,现在这个路由条目被network语句进行宣告了,所以是内部路由
三、
1、配置如上
2、R2配置
ip default-network 12.0.0.0
ip route 12.0.0.0 255.0.0.0 f0/1 用于network宣告
router eigrp 90
network 12.0.0.0
3、查看R3上结果
Gateway of last resort is 23.1.1.2 to network 12.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/409600] via 23.1.1.2, 00:14:10, FastEthernet0/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet0/1
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 12.1.1.0/24 [90/307200] via 23.1.1.2, 00:10:28, FastEthernet0/1
D* 12.0.0.0/8 [90/307200] via 23.1.1.2, 00:00:06, FastEthernet0/1
看到了最下面的一条,看它是否是默认路由看上面的
Gateway of last resort is 23.1.1.2 to network 12.0.0.0
设备网关设置了,说明这就是默认路由
在R3上ping 4.4.4.4不存在网络 可以看到
sending
*Mar 1 00:51:45.979: ICMP type=8, code=0
*Mar 1 00:51:46.007: IP: tableid=0, s=23.1.1.2 (FastEthernet0/1), d=23.1.1.3 (FastEthernet0/1), routed via RIB
说明默认路由起作用了。
四、手工汇总
1、配置如上
2、R2上的配置
interface f0/0
ip summary-address eigrp 90 0.0.0.0 0.0.0.0
show ip route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/409600] via 23.1.1.3, 00:00:20, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/1
D* 0.0.0.0/0 is a summary, 00:00:52, Null0
看到底下的 Null0接口了吗?该设备也起了默认路由了
3、查看R3上的配置结果
router eigrp 90
在EIGRP进程下,默认有一条network 0.0.0.0 0.0.0.0语句
Gateway of last resort is 23.1.1.2 to network 0.0.0.0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet0/1
D* 0.0.0.0/0 [90/409600] via 23.1.1.2, 00:04:17, FastEthernet0/1
可以看到配置成功
高级特性:
1、自动汇总
router eigrp 90
auto-summary 开启自动汇总
show ip route 查看本地R3上的路由表
Gateway of last resort is 23.1.1.2 to network 0.0.0.0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Loopback0
D 3.0.0.0/8 is a summary, 00:03:04, Null0
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:00:33, Null0
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback5
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 23.1.1.0/24 is directly connected, FastEthernet0/1
D 23.0.0.0/8 is a summary, 00:00:35, Null0
D* 0.0.0.0/0 [90/409600] via 23.1.1.2, 00:10:29, FastEthernet0/1
从上面可以看到,只有被network宣告进EIGRP进程的路由条目才会被自动汇总
而能被network宣告的路由条目,是直连路由。自动汇总后,同时产生一个Null0接口
Null0接口,也可以叫它垃圾桶接口,用来防止路由黑洞的。
show ip route 23.0.0.0 255.255.255.0
查看23.0.0.0/8的路由条目的详细信息
R3#show ip route 23.0.0.0 255.0.0.0
Routing entry for 23.0.0.0/8
Known via "eigrp 90", distance 5, metric 281600, type internal
Redistributing via eigrp 90
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 281600, traffic share count is 1
Total delay is 1000 microseconds, minimum bandwidth is 10000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 0
Null0接口的管理距离是5,只具有本地意义,不传递给任何人
与RIP的区别就是:RIP会把本地路由的条目与发送更新接口IP进行比较,如果不是同一个主类网络
的话,就进行自动汇总,不管它是本地还是邻居传来的路由。
2、手工汇总:基于链路级的汇总
手工汇总也会在本地路由表产生一个Null0接口,如上
ip summary-address eigrp 90 0.0.0.0 0.0.0.0
本地路由也产生一个该汇总路由的Null0接口
R3上的配置:
interface f0/1
ip summary-address eigrp 90 192.168.8.0 255.255.252.0 100
show ip route 192.168.8.0 255.255.252.0查看该路由条目的具体信息
R3#show ip route 192.168.8.0 255.255.252.0
Routing entry for 192.168.8.0/22, supernet
Known via "eigrp 90", distance 100, metric 128256, type internal
Redistributing via eigrp 90
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 128256, traffic share count is 1
Total delay is 5000 microseconds, minimum bandwidth is 10000000 Kbit
Reliability 255/255, minimum MTU 1514 bytes
Loading 1/255, Hops 0
管理距离就是100.默认是5
leak-map就是泄漏列表,通过调用route-map,route-map调用acl,抓取感兴趣的数据流量
route-map test permit 10
match ip address 10
access-list 10 permit 192.168.8.0 0.0.1.0
interface f0/1
ip summary-address eigrp 90 192.168.8.0 255.255.252.0 leak-map test
查看R2的路由表
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/409600] via 23.1.1.3, 00:08:34, FastEthernet0/0
D 192.168.8.0/24 [90/409600] via 23.1.1.3, 00:00:25, FastEthernet0/0
4.0.0.0/24 is subnetted, 1 subnets
D 4.4.4.0 [90/409600] via 23.1.1.3, 00:08:34, FastEthernet0/0
D 192.168.9.0/24 [90/409600] via 23.1.1.3, 00:00:25, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/1
D* 0.0.0.0/0 is a summary, 00:41:54, Null0
D 192.168.8.0/22 [90/409600] via 23.1.1.3, 00:00:08, FastEthernet0/0
看到没?有汇总路由,也有我们泄漏列表里的明细路由条目
3、负载均衡:
EIGRP 支持非等价负载均衡,用命令variance {2,,128},就可以实现非等价负载均衡
本地拓扑表中到10.1.1.0 /24网络的路由条目:
1、FD 30 AD 10
2、FD 20 AD 10
3、FD 45 AD 25
首先我们判断最优路由和备份路由
FD20是最小,所以是最优路由。备份路由有吗?要怎么判断?
这就需要FC来判断了,规则如下:
次优路由的AD必须小于最优路由的FD,由此我们可以判断条目1可以成为备份路由
而条目25大于最优路由的FD20,所以不能成为备份路由
给最优路由选择备份路由是DUAL算法的本地计算
那么这样的拓扑表中的路由,可以实现非等价负载均衡吗?
首先要满足第一条件:最优路由FD*variance值必须大于次优路由的FD,这条基本都能实现
比如,上面的例子,我们使用variance的值为2
40大于第一条目,但小于条目三,可以继续增加variance的值,但能无限制增大吗?
答案是否定的,这就需要考察第二个条件,也就是FC
FC=次优路由的AD需要小于最优路由的FD
而这里只有第一条目适合,所以该路由条目可以和最优路由实现非等价负载均衡
那多少数据包走最优路由,剩下多少走次优路由呢?
R1#show ip route 2.2.2.2 255.255.255.0
Routing entry for 2.2.2.0/24
Known via "eigrp 90", distance 90, metric 2297856, type internal
Redistributing via eigrp 90
Last update from 12.1.1.2 on Serial1/0, 00:04:34 ago
Routing Descriptor Blocks:
* 12.1.1.2, from 12.1.1.2, 00:04:34 ago, via Serial1/0
Route metric is 2297856, traffic share count is 1
Total delay is 25000 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1
看到红色了吗?那就是该链路负载均衡时,走的数据可以从这边看到
广域网EIGRP的增强特性(考虑到WAN带宽的不足)
EIGRP在任何接口,默认EIGRP数据不超过链路带宽(也是管理带宽)的50%
在接口模式下:interface s1/0
ip bandwidth-percent eigrp 90 百分比
bandwidth 设置管理带宽
两者结合使用,可灵活限制EIGRP的数量流量
DUAL算法
本地计算:
1、在计算出最优路由后,寻找备份路由
2、在最优路由down掉后,查询拓扑表,有没有备份路由
有的话,切换到备份路由,并发送路由更新,告诉邻居拓扑的变化
扩散更新算法:将被查询路由在路由表中删除,并在拓扑表中,将该路由条目置为ACTIVE
并发送路由更新,置该路由条目FD为无穷大。查询报文是发给邻居的。
下面是邻居收到报文做的判断原则
1、发送查询的报文的路由器是否是它的后继站
(目的就是为了,问下,有没有谁是我去往该路由的下一跳)
如果不是下一跳设备,则将自己路由表中的后继站路由发送给查询者
2、如果是的话,则查看拓扑表是否有备份路由
有的话,切换到备份路由,并发送给查询者
无的话,就看自己是否有邻居
有的话,再发一个查询给邻居,并置该路由条目为active
无的话,直接告知查询者,目标网络不可达
3、如果接受者没有该路由条目的信息,则直接回复不可达
咱实际走一圈:
10.1.1.0/24
1 |
A 1^ D
2 | 2* 1|
C--1--E
stub特性:
eigrp stub
receive-only (只收不发)
connected 将本地直连路由发送给邻居
summary 将汇总路由发送给邻居
static 将重分发的static路由发送给邻居
redistribute 将重分发的路由发送给邻居
就是发送出去的查询报文,多少秒后重置该邻接关系
stuck in active 180s 重置邻接关系
这里就要发送SIA query报文和reply报文
查询到一半时间,没有回复,就发送query报文,询问是否工作,在工作则重置该时间
这样的操作最多重复7次+180s后重置
goodbye报文
就是设备不运行EIGRP协议的时候,设备发送goodbye报文,告诉邻居设备
EIGRP的stub特性:
基本的配置略过,在边界路由器R2上做stub特性
router eigrp 90
eigrp stub
我们就在回车,查看命令有什么不同。show ip protocols
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
EIGRP stub, connected, summary
Redistributing: eigrp 90
EIGRP NSF-aware route hold timer is 240s
也就是说默认有connected和summary参数,它们有什么用处呢?让我们来验证下
在R1上show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/409600] via 12.1.1.2, 00:04:29, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
D 23.1.1.0 [90/307200] via 12.1.1.2, 00:04:29, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
我们看到3.3.3.0/24这条路由消失了,为什么呢?
我们看到eigrp stub connected,summary中的connected就是指将直连路由宣告进EIGRP进程
而summary就是将汇总的路由宣告进EIGRP进程。这下我们原因知道了吧。
再来验证下汇总这个参数。
将R2上开启auto-summary功能,show ip route
1.0.0.0/24 is subnetted, 1 subnets
D 1.1.1.0 [90/409600] via 12.1.1.1, 00:09:51, FastEthernet0/1
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, Loopback0
D 2.0.0.0/8 is a summary, 00:00:06, Null0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/409600] via 23.1.1.3, 00:09:53, FastEthernet0/0
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 23.1.1.0/24 is directly connected, FastEthernet0/0
D 23.0.0.0/8 is a summary, 00:00:07, Null0
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, FastEthernet0/1
D 12.0.0.0/8 is a summary, 00:00:07, Null0
看看汇总路由有几条在宣告进了EIGRP进程,在R1 show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
D 2.0.0.0/8 [90/409600] via 12.1.1.2, 00:00:36, FastEthernet0/0
D 23.0.0.0/8 [90/307200] via 12.1.1.2, 00:00:36, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
呵呵,明细路由没有了哦,并且3.0.0.0/8没有宣告进来,为什么呢?
那是因为EIGRP只会宣告直连路由。
eigrp stub static 查看R1路由表变化,这里只会宣告静态路由
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
我们将在R2上做条静态路由,ip route 100.1.1.0 255.255.255.0 f0/1
查看R1路由表,好像没啥变化嘛!
哦,对了,需要将该条景静态路由宣告进EIGRP进程
router eigrp 90
redistribute static
show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
100.0.0.0/24 is subnetted, 1 subnets
D EX 100.1.1.0 [170/307200] via 12.1.1.2, 00:00:04, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
呵呵,感觉还蛮不错的嘛、。继续、、、、算了,意思基本能理解了
成为邻居的条件:
1、相同的进程号(或AS号)
2、不同的RID
3、K值相同(修改K值命令:EIGR进程下,metric weights 0 k1 k2 k3 k4 k5)
4、认证,只支持密文认证
R1:
key chain R1
key 1
key-string cisco
exit
exit
interface f0/0
ip authentication key-chain eigrp 90 R1
ip authentication mode eigrp 90 md5
R2:
key chain R2
key 1
key-string cisco
exit
exit
interface f0/1
ip authentication key-chain eigrp 90 R2
ip authentication mode eigrp 90 md5
key chain的说法
send-lifetime 发送时间的限制
accept-lifetime 审核时间的限制
单播:
neighbor 12.1.1.2 f0/1 和RIP有点不同,需要指定接口,而且两端都需要配
关闭水平分割:
no ip split-horizon
no ip split-horizon eigrp 90 两条多说