EIGRP(Enhanced IGRP)
增强型内部网关路由协议
注意:这是cisco私有协议;也就是说,该协议只能运行在思科的设备上,如果有其他的厂家的设备,则不能保证能运行此协议;
EIGRP的特点:
- 高级距离矢量协议 - 具有距离矢量性和链路状态协议特征
- 无类路由协议 - 可划分子网、可聚合子网路由
- 支持VLSM与不连续子网
- 100%五环路 - DUAL算法
- 快速收敛 - 路由条目不过期,拥有备份路由
- 触发更新
- 底路由更新信息开销
- 配置简单
- 支持多种网络层协议(IP、IPX、Appletalk、etc)
EIGRP的五种报文:
HELLO分组 | 以224.0.0.10发送,无需确认Hello包 EIGRP依靠分组来发现,验证和重新发现邻居router 以固定的时间发送hello包,该时间间隔与接口贷款有关 LAN上默认为5s |
更新 | EIGRP协议的这双鞋更新数据包只在必要的时候传递必要的信息,而且仅仅传递给需要路由信息的路由器。当只有某一制定的路由器需要路有更新时,更新数据包就是单播发送的;当有多台路由器更新时,更新数据包就是组播发送的 以可靠的方式发送,需要确认 |
查询 | 当某条路有丢失,向邻居查询关于路由信息,通常靠组播方式发送,有时也用单播重传;可靠地发送 |
应答 | 相应查询分组,单播;可靠方式发送 |
确认(ACK) | 以单播发送的HELLO包(不包含数据),包含确认号。用来确认更新、查询和应答。ACk本身不需要确认。 |
上图中,如果是RIP协议的话,则肯定会选择走Metric值小的那一条路由,就是由A路由直接到C路由,而如果是EIGRP协议,则会选择走B路由到C路由去,因为会根据算法选择线路更优的线路。
而通过show ip route
命令查看路由表,以D
开头的,则表示通过EIGRP协议同步的路由表,D
全称是DUAl
,表示EIGRP协议。
EIGRP协议中的Metric值的计算公式如下图:
来看下计算案例:
DUAL算法
Diffusing Update Algorithm 用于计算最佳无环路径和备用路径
特点:
- 无环拓扑
- 可立即使用的无环备用路径
- 跨苏收敛
- 低带宽利用率(通过限定更新实现)
几个术语:
- 后继路由器
Successors
被实际选中作为到达一个目的地所使用的下一跳路由器。改条路由保存在路由表中。
- 可行距离(Feasible Distance)
计算出的桐乡目的网络最小的度量。
- 可行后继路由器(Feasible Successor)
是一条备份路由,只保存在拓扑表中。要成为可行后继,吓一跳路由器前往某个特定网络的
AD
必须必当前后继的FD
小。
- 通告距离(Advertise Distance)
即为
EIGRP
邻居桐乡相同目的网络的它自己的可行距离。
- 可行条件,或称可行性条件(Feasible Condition)
符合了可行性条件Feasible Condition指当邻居桐乡一个网络的通告距离(AD)比本地路由器桐乡同一个目的网络的可行距离短时;
EIGRP的其他特性
- 最多支持等价的路径的跳数不同的IOS版本不同进行负载(默认是4条)
- 可以通过maximum-paths修改
EIGRP动手配置
根据下面图中拓扑,配置EIGRP
R1的配置
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int s 0/0
R1(config-if)#ip add 192.168.12.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#int s 0/1
R1(config-if)#ip add 192.168.13.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#router eigrp 1
R1(config-router)#network 192.168.12.0 0.0.0.255
R1(config-router)#network 192.168.13.0 0.0.0.255
R1(config-router)#end
R2的配置
R2>en
R2#conf t
R2(config)#int s 0/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ex
R2(config)#int s 0/1
R2(config-if)#ip add 192.168.23.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ex
R2(config)#router eigrp 1
R2(config-router)#network 192.168.23.0 0.0.0.255
R2(config-router)#
*Mar 1 00:03:42.211: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down
R2(config-router)#network 192.168.12.0 0.0.0.255
R2(config-router)#end
R3的配置
R3>en
R3#conf t
R3(config)#int s0/0
R3(config-if)#ip add 192.168.13.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#int s 0/1
R3(config-if)#ip add 192.168.23.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#ex
R3(config)#router eigrp 1
R3(config-router)#network 192.168.13.0 0.0.0.255
R3(config-router)#network 1
*Mar 1 00:07:18.051: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.13.1 (Serial0/0) is up: new adjacency
R3(config-router)#network 192.168.23.0 0.0.0.255
R3(config-router)#
*Mar 1 00:07:29.903: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.23.2 (Serial0/1) is up: new adjacency
R3(config-router)#network 3.0.0.0
R3(config-router)#end
配置检查
R1检查
R1#show 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
C 192.168.12.0/24 is directly connected, Serial0/0
C 192.168.13.0/24 is directly connected, Serial0/1
D 3.0.0.0/8 [90/2297856] via 192.168.13.3, 00:00:02, Serial0/1
D 192.168.23.0/24 [90/2681856] via 192.168.13.3, 00:00:34, Serial0/1
[90/2681856] via 192.168.12.2, 00:00:34, Serial0/0
R1#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
1 192.168.13.3 Se0/1 14 00:00:59 35 210 0 12
0 192.168.12.2 Se0/0 13 00:03:05 56 336 0 11
R1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/22/84 ms
R1#ping 192.168.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/27/108 ms
R1#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/16/44 ms
R1#show ip eigrp topology all-links
IP-EIGRP Topology Table for AS(1)/ID(192.168.13.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 3.0.0.0/8, 1 successors, FD is 2297856, serno 7
via 192.168.13.3 (2297856/128256), Serial0/1
via 192.168.12.2 (2809856/2297856), Serial0/0
P 192.168.12.0/24, 1 successors, FD is 2169856, serno 2
via Connected, Serial0/0
P 192.168.13.0/24, 1 successors, FD is 2169856, serno 3
via Connected, Serial0/1
P 192.168.23.0/24, 2 successors, FD is 2681856, serno 6
via 192.168.12.2 (2681856/2169856), Serial0/0
via 192.168.13.3 (2681856/2169856), Serial0/1
R1#sho ip protocols
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 in effect
Automatic address summarization:
192.168.13.0/24 for Serial0/0
192.168.12.0/24 for Serial0/1
Maximum path: 4
Routing for Networks:
192.168.12.0
192.168.13.0
Routing Information Sources:
Gateway Distance Last Update
192.168.13.3 90 22:03:28
192.168.12.2 90 22:03:28
Distance: internal 90 external 170
R2检查
R2#show 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
C 192.168.12.0/24 is directly connected, Serial0/0
D 192.168.13.0/24 [90/2681856] via 192.168.23.3, 00:00:58, Serial0/1
[90/2681856] via 192.168.12.1, 00:00:58, Serial0/0
D 3.0.0.0/8 [90/2297856] via 192.168.23.3, 00:00:26, Serial0/1
C 192.168.23.0/24 is directly connected, Serial0/1
R3检查
R3#show 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
D 192.168.12.0/24 [90/2681856] via 192.168.23.2, 22:24:22, Serial0/1
[90/2681856] via 192.168.13.1, 22:24:22, Serial0/0
C 192.168.13.0/24 is directly connected, Serial0/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, 22:23:50, Null0
C 192.168.23.0/24 is directly connected, Serial0/1