EIGRP是增强型内部网关路由协议,是一个动态路由协议,为了弥补RIP动态路由协议缺陷而出现的,属于Cisco私有协议。
RIP缺陷:
- 跳数作为Metric不能准确衡量一个路径质量的好坏;
- RIP最大只能支持15跳,后面不可达,不适合大型网络;
- RIP是30s更新一次,180s不更新就down,收敛时间较慢,不适合大型网络;
- RIP对整张路由表进行更新,大型网络中路由条目较多,会占用带宽资源。
EIGRP特性:
- 动态路由协议 ;
- 高级距离矢量/混合矢量路由协议;
- 属于内部网关协议(IGP);
- 无类路由协议。
下面就来配置一个拓扑来学习一下EIGRP协议。
一、路由IP配置
1.R1配置:
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface f0/0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#
*Mar 1 00:01:04.119: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:01:05.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#end
R1#
*Mar 1 00:01:06.919: %SYS-5-CONFIG_I: Configured from console by console
R1#write memory
Building configuration...
[OK]
2.R2配置:
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#interface f0/0
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
*Mar 1 00:01:40.871: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
R2#
*Mar 1 00:01:41.519: %SYS-5-CONFIG_I: Configured from console by console
*Mar 1 00:01:41.871: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2#write memory
Building configuration...
[OK]
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#interface f0/1
R2(config-if)#ip address 10.1.2.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
*Mar 1 00:02:41.411: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Mar 1 00:02:41.491: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar 1 00:02:42.491: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2#write memory
Building configuration...
[OK]
3.R3配置:
R3#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#interface f0/0
R3(config-if)#ip address 10.1.2.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
*Mar 1 00:02:40.235: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
R3#
*Mar 1 00:02:41.071: %SYS-5-CONFIG_I: Configured from console by console
*Mar 1 00:02:41.235: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3#write memory
Building configuration...
[OK]
二、EIGRP路由配置
如上图,想把10.1.2.0网段宣告给R1我们现在有三种方法:静态路由、RIP协议、EIGRP协议。下面就来配置一些EIGRP协议。
R1上配置EIGRP协议:
R1#configure ter
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router eigrp ?
<1-65535> Autonomous system number
R1(config)#router eigrp 1
R1(config-router)#network 10.0.0.0
这时候来看看路由表,还没有R3网段的路由。
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
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
R2上配置EIGRP协议:
R2#configure ter
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router eigrp 1
R2(config-router)#network 10.1.0.0
R2(config-router)#
*Mar 1 01:07:08.831: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.1.1 (FastEthernet0/0) is up: new adjacency
这里要注意router eigrp 1这里的自制系统号要和上面R1中一样,除此之外还多了一行*Mar 1 01:07:08.831: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.1.1 (FastEthernet0/0) is up: new adjacency,表示一个连接关系的变化,这里会显示邻居改变的出接口和线程(自制系统号)以及其他信息,这也是和RIP协议不同的地方。
这时候回头再看看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
10.0.0.0/24 is subnetted, 2 subnets
D 10.1.2.0 [90/30720] via 10.1.1.2, 00:03:44, FastEthernet0/0
C 10.1.1.0 is directly connected, FastEthernet0/0
已经新增加了一条路由,通过show ip eigrp neighbors查看邻居信息。
R1#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 10.1.1.2 Fa0/0 11 00:05:27 37 222 0 3
- H:序号
- Address:邻居IP
- Interface:自己与邻居建立关系的出接口
- Hold:发送邻居信息间隔(00-15s)
- Uptime:建立邻居关系总时间
- SRTT:一个完整请求和回复耗时
- RTO:超时重传时间
- Q:剩余数据包数量-队列(不为零表示网络有问题)
- Seq:队列
以上就是一个完整EIGRP动态路由的配置过程,这时候我们再来看看ping的结果如何:
R1#ping 10.1.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/21/32 ms
如果想ping 10.1.2.2就要在R3上进行同样的EIGRP配置,并把网段宣告出去。