实验目的:
1、理解EIGRP的路由更新机制。
2、掌握EIGRP的调试命令。
3、掌握stub的配置及使用路由汇总限制EIGRP的查询范围。
实验拓扑:
实验步骤:
1、配置各路由器的名称、相连接口IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
R1配置:
R1(config)#int fa0/0
R1(config-if)#ip add 192.138.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int s1/2
R1(config-if)#ip add 172.16.1.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int loop 1
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#exit
R2、R3类似。
2、给三台路由器配置EGIRP协议,自治系统号为80。本次实验采用通配符掩码配置R1的回环口。
R1(config)#router eigrp 80
R1(config-router)#network 172.16.0.0
R1(config-router)#network 192.138.0.0
R1(config-router)#network 10.1.0.0 0.0.255.255
R2、R3同理配置好。
3、查看R1、R2与R3的路由表,确认EIGRP工作正常。
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
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
D 172.16.1.4/30 [90/2681856] via 172.16.1.2, 00:01:48, Serial1/2
D 172.16.0.0/16 is a summary, 00:02:48, Null0
C 172.16.1.0/30 is directly connected, Serial1/2
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Loopback1
D 10.0.0.0/8 is a summary, 00:02:48, Null0
C 192.138.1.0/24 is directly connected, FastEthernet0/0
R2:
R2#sh ip route eigrp
D 10.0.0.0/8 [90/2297856] via 172.16.1.1, 00:08:27, Serial1/0R3:
R3#sh ip route eigrp
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.1.0 [90/2681856] via 172.16.1.5, 00:03:17, Serial1/2
D 10.0.0.0/8 [90/2809856] via 172.16.1.5, 00:03:17, Serial1/2
4、在R2路由器上使用debug命令跟踪EIGRP的更新。
R2#debug eigrp fsm
EIGRP FSM Events/Actions debugging is on
R2#debug eigrp packets query
EIGRP Packets debugging is on
(QUERY)
===debug eigrp fsm :这条调试命令显示关于EIGRPfeasible successor度量值(FSM)的信息。
===debug eigrp packet :这条调试命令显示在路由器间的任意EIGRP报文行进的信息。
5、在R1路由器上使用shutdown命令,重激活loopback的接口,模拟网络出错。
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int loop 1
R1(config-if)#shutdown
R1(config-if)#
*Oct 18 22:45:10.883: %LINK-5-CHANGED: Interface Loopback1, changed state to administratively down
此刻观察R2的输出结果:
R2#
*Oct 18 22:45:08.635: EIGRP: Received QUERY on Serial1/0 nbr 172.16.1.1
*Oct 18 22:45:08.639: AS 80, Flags 0x0, Seq 3/2 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Oct 18 22:45:08.643: DUAL: dest(10.1.1.0/24) not active
*Oct 18 22:45:08.643: DUAL: rcvquery: 10.1.1.0/24 via 172.16.1.1 metric 4294967295/4294967295, RD is 4294967295
*Oct 18 22:45:08.647: DUAL: send REPLY(r1/n1) about 10.1.1.0/24 to 172.16.1.1
*Oct 18 22:45:08.647: DUAL: dest(172.16.0.0/16) not active
*Oct 18 22:45:08.651: DUAL: rcvquery: 172.16.0.0/16 via 172.16.1.1 metric 4294967295/4294967295, RD is 4294967295
*Oct 18 22:45:08.655: DUAL: send REPLY(r1/n1) about 172.16.0.0/16 to 172.16.1.1
*Oct 18 22:45:08.655: DUAL: rcvquery: 10.0.0.0/8 via 172.16.1.1 metric 4294967295/4294967295, RD is 2297856
*Oct 18 22:45:08.659: DUAL: Find FS for dest 10.0.0.0/8. FD is 2297856, RD is 2297856
*Oct 18 22:45:08.659: DUAL: 172.16.1.1 metric 4294967295/4294967295 not found Dmin is 4294967295
*Oct 18 22:45:08.663: DUAL: Peer total/stub 2/0 template/full-stub 2/0
*Oct 18 22:45:08.663: DUAL: Dest 10.0.0.0/8 entering active state.
*Oct 18 22:45:08.663: DUAL: Set reply-status table. Count is 2.
*Oct 18 22:45:08.663: DUAL: Not doing split horizon
*Oct 18 22:45:08.663: DUAL: Going from state 1 to state 3
*Oct 18 22:45:08.675: EIGRP: Enqueueing QUERY on Serial1/1 iidbQ un/rely 0/1 serno 6-6
*Oct 18 22:45:08.679: EIGRP: Enqueueing QUERY on Serial1/1 nbr 172.16.1.6 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 6-6
*Oct 18 22:45:08.683: EIGRP: Sending QUERY on Serial1/1 nbr 172.16.1.6
*Oct 18 22:45:08.687: AS 80, Flags 0x0, Seq 5/2 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 6-6
*Oct 18 22:45:08.703: DUAL: Removing dest 10.1.1.0/24, nexthop 172.16.1.1
*Oct 18 22:45:08.703: DUAL: No routes. Flushing dest 10.1.1.0/24
*Oct 18 22:45:08.703: DUAL: Removing dest 172.16.0.0/16, nexthop 172.16.1.1
*Oct 18 22:45:08.703: DUAL: No routes. Flushing dest 172.16.0.0/16
*Oct 18 22:45:08.703: EIGRP: Enqueueing QUERY on Serial1/0 iidbQ un/rely 0/1 serno 6-6
*Oct 18 22:45:08.707: EIGRP: Enqueueing QUERY on Serial1/0 nbr 172.16.1.1 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 6-6
*Oct 18 22:45:08.711: EIGRP: Sending QUERY on Serial1/0 nbr 172.16.1.1
*Oct 18 22:45:08.715: AS 80, Flags 0x0, Seq 6/3 idbQ 1/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 6-6
*Oct 18 22:45:08.739: DUAL: dest(10.0.0.0/8) active
*Oct 18 22:45:08.739: DUAL: rcvreply: 10.0.0.0/8 via 172.16.1.6 metric 4294967295/4294967295
*Oct 18 22:45:08.739: DUAL: reply count is 2
*Oct 18 22:45:08.739: DUAL: Clearing handle 1, count now 1
*Oct 18 22:45:08.739: DUAL: Removing dest 10.0.0.0/8, nexthop 172.16.1.6
*Oct 18 22:45:08.779: DUAL: rcvreply: 10.0.0.0/8 via 172.16.1.1 metric 4294967295/4294967295
*Oct 18 22:45:08.779: DUAL: reply count is 1
*Oct 18 22:45:08.779: DUAL: Clearing handle 0, count now 0
*Oct 18 22:45:08.783: DUAL: Freeing reply status table
*Oct 18 22:45:08.783: DUAL: Find FS for dest 10.0.0.0/8. FD is 4294967295, RD is 4294967295 found
*Oct 18 22:45:08.787: DUAL: send REPLY(r1/n1) about 10.0.0.0/8 to 172.16.1.1
*Oct 18 22:45:08.787: DUAL: Going from state 3 to state 1
*Oct 18 22:45:08.843: DUAL: Removing dest 10.0.0.0/8, nexthop 172.16.1.1
*Oct 18 22:45:08.843: DUAL: No routes. Flushing dest 10.0.0.0/8
根据提示,可以发现共有4查询包,与之相对应的会产生4个回复包。如果在实际应用中,使用EIGRP的网络可以多达数十台及数百台路由,那么如果出现某个网络出错,则有可以引起整个网络产生大量的查询回复包。所以为了避免这样的问题,可以使用ip summary命令或stub参数来进行配置EIGRP,限制EIGRP的查询范围。
6、在R1、R3上进行路由汇总
R1:
R1(config)#int loop 1
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int s1/2
R1(config-if)#ip summary-address eigrp 80 10.0.0.0 255.0.0.0
R3:
R3(config)#int s1/2
R3(config-if)#ip summary-address eigrp 80 10.0.0.0 255.0.0.0
7、观察R2、R3的路由表,确认已经学习到 10.1.1 .0/24的网络汇总路由。
R2:
R2#sh ip route eigrp
D 10.0.0.0/8 [90/2297856] via 172.16.1.1, 00:00:46, Serial1/0
R3:
R2# ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/17/40 ms
R3:
R3#sh ip route eigrp
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.1.0 [90/2681856] via 172.16.1.5, 00:08:23, Serial1/2
D 10.0.0.0/8 [90/2809856] via 172.16.1.5, 00:08:23, Serial1/2
R3#ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/40/48 ms
8、在R1路由器上,再次shutdown掉loopback0接口,同时观察R2的debug信息。
R2#
*Oct 18 23:01:28.843: EIGRP: Received QUERY on Serial1/0 nbr 172.16.1.1 ①
*Oct 18 23:01:28.847: AS 80, Flags 0x0, Seq 8/12 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Oct 18 23:01:28.851: DUAL: dest(10.1.1.0/24) not active
*Oct 18 23:01:28.851: DUAL: rcvquery: 10.1.1.0/24 via 172.16.1.1 metric 4294967295/4294967295, RD is 4294967295
*Oct 18 23:01:28.855: DUAL: send REPLY(r1/n1) about 10.1.1.0/24 to 172.16.1.1
*Oct 18 23:01:28.855: DUAL: dest(172.16.0.0/16) not active
*Oct 18 23:01:28.859: DUAL: rcvquery: 172.16.0.0/16 via 172.16.1.1 metric 4294967295/4294967295, RD is 4294967295
*Oct 18 23:01:28.859: DUAL: send REPLY(r1/n1) about 172.16.0.0/16 to 172.16.1.1 I
*Oct 18 23:01:28.863: DUAL: rcvquery: 10.0.0.0/8 via 172.16.1.1 metric 4294967295/4294967295, RD is 2297856
*Oct 18 23:01:28.867: DUAL: Find FS for dest 10.0.0.0/8. FD is 2297856, RD is 2297856
*Oct 18 23:01:28.867: DUAL: 172.16.1.1 metric 4294967295/4294967295 not found Dmin is 4294967295
*Oct 18 23:01:28.867: DUAL: Peer total/stub 2/0 template/full-stub 2/0
*Oct 18 23:01:28.867: DUAL: Dest 10.0.0.0/8 entering active state.
*Oct 18 23:01:28.867: DUAL: Set reply-status table. Count is 2.
*Oct 18 23:01:28.867: DUAL: Not doing split horizon
*Oct 18 23:01:28.867: DUAL: Going from state 1 to state 3
*Oct 18 23:01:28.879: EIGRP: Enqueueing QUERY on Serial1/1 iidbQ un/rely 0/1 serno 13-13
*Oct 18 23:01:28.883: EIGRP: Enqueueing QUERY on Serial1/1 nbr 172.16.1.6 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 13-13
*Oct 18 23:01:28.887: EIGRP: Sending QUERY on Serial1/1 nbr 172.16.1.6 ②
*Oct 18 23:01:28.891: AS 80, Flags 0x0, Seq 16/8 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 13-13
*Oct 18 23:01:28.915: DUAL: Removing dest 10.1.1.0/24, nexthop 172.16.1.1
*Oct 18 23:01:28.915: DUAL: No routes. Flushing dest 10.1.1.0/24
*Oct 18 23:01:28.915: DUAL: Removing dest 172.16.0.0/16, nexthop 172.16.1.1
*Oct 18 23:01:28.915: DUAL: No routes. Flushing dest 172.16.0.0/16
*Oct 18 23:01:28.915: EIGRP: Enqueueing QUERY on Serial1/0 iidbQ un/rely 0/1 serno 13-13
*Oct 18 23:01:28.919: EIGRP: Enqueueing QUERY on Serial1/0 nbr 172.16.1.1 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 13-13
*Oct 18 23:01:28.923: EIGRP: Sending QUERY on Serial1/0 nbr 172.16.1.1 II
*Oct 18 23:01:28.927: AS 80, Flags 0x0, Seq 17/8 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 13-13
*Oct 18 23:01:28.931: DUAL: dest(10.0.0.0/8) active
*Oct 18 23:01:28.935: DUAL: rcvreply: 10.0.0.0/8 via 172.16.1.6 metric 4294967295/4294967295
*Oct 18 23:01:28.935: DUAL: reply count is 2
*Oct 18 23:01:28.935: DUAL: Clearing handle 1, count now 1
*Oct 18 23:01:28.939: DUAL: Removing dest 10.0.0.0/8, nexthop 172.16.1.6
*Oct 18 23:01:28.991: DUAL: rcvreply: 10.0.0.0/8 via 172.16.1.1 metric 4294967295/4294967295
*Oct 18 23:01:28.991: DUAL: reply count is 1
*Oct 18 23:01:28.991: DUAL: Clearing handle 0, count now 0
*Oct 18 23:01:28.991: DUAL: Freeing reply status table
*Oct 18 23:01:28.991: DUAL: Find FS for dest 10.0.0.0/8. FD is 4294967295, RD is 4294967295 found
*Oct 18 23:01:28.991: DUAL: send REPLY(r1/n1) about 10.0.0.0/8 to 172.16.1.1 III
*Oct 18 23:01:28.991: DUAL: Going from state 3 to state 1
*Oct 18 23:01:29.063: DUAL: Removing dest 10.0.0.0/8, nexthop 172.16.1.1
*Oct 18 23:01:29.063: DUAL: No routes. Flushing dest 10.0.0.0/8
通过配置汇总,我们可以发现,本次查询中只有2次关于 10.1.1 .0/24的网络查询。如日志里面的阴暗部分,为了方便查寻我用圆圈标示了第一、二次。另外3个查询是由于配置了汇总后。R1和R3查询10.0.0.0/8的网络而产生的,用粗体表示,并用罗马字体标示了顺序。
9、为了能够彻底解决查询的问题。我们在R2上配置EIGRP stub的特性。以阻止向路由器R2查询 10.0.0 .0/8的网络路由:
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router eigrp 80
R2(config-router)#eigrp stub //配置R2为末节属性。
在R1或R3上查看邻居表,观察末节特性。
R1#sh ip eigrp nei detail
IP-EIGRP neighbors for process 80
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 172.16.1.2 Se1/2 12 00:00:43 631 3786 0 19
Version 12.3/1.2, Retrans: 0, Retries: 0
Stub Peer Advertising ( CONNECTED SUMMARY ) Routes // EIGRP不会向被配置了末节特性的路由器查询其它网络的路由。
Suppressing queries
10、最后我们再来一次对R1的loopback 端口关闭、激活一次,观察R2路由器的提示信息:
R2(config-router)#
*Oct 18 23:09:04.675: DUAL: rcvupdate: 10.0.0.0/8 via 172.16.1.1 metric 4294967295/4294967295
*Oct 18 23:09:04.675: DUAL: Find FS for dest 10.0.0.0/8. FD is 2297856, RD is 2297856
*Oct 18 23:09:04.679: DUAL: 172.16.1.1 metric 4294967295/4294967295 not found Dmin is 4294967295
*Oct 18 23:09:04.679: DUAL: Peer total/stub 2/0 template/full-stub 2/0
*Oct 18 23:09:04.679: DUAL: Dest 10.0.0.0/8 entering active state.
*Oct 18 23:09:04.679: DUAL: Set reply-status table. Count is 2.
*Oct 18 23:09:04.679: DUAL: Not doing split horizon
*Oct 18 23:09:04.691: EIGRP: Enqueueing QUERY on Serial1/0 iidbQ un/rely 0/1 serno 16-16
*Oct 18 23:09:04.695: EIGRP: Enqueueing QUERY on Serial1/1 iidbQ un/rely 0/1 serno 16-16
*Oct 18 23:09:04.695: EIGRP: Enqueueing QUERY on Serial1/0 nbr 172.16.1.1 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 16-16
*Oct 18 23:09:04.699: EIGRP: Enqueueing QUERY on Serial1/1 nbr 172.16.1.6 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 16-16
*Oct 18 23:09:04.703: EIGRP: Sending QUERY on Serial1/0 nbr 172.16.1.1 //向R1查询
*Oct 18 23:09:04.707: AS 80, Flags 0x0, Seq 23/13 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 16-16
*Oct 18 23:09:04.711: EIGRP: Sending QUERY on Serial1/1 nbr 172.16.1.6//向R3查询
*Oct 18 23:09:04.711: AS 80, Flags 0x0, Seq 24/11 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 16-16
*Oct 18 23:09:04.755: DUAL: rcvreply: 10.0.0.0/8 via 172.16.1.1 metric 4294967295/4294967295
*Oct 18 23:09:04.755: DUAL: reply count is 2
*Oct 18 23:09:04.755: DUAL: Clearing handle 0, count now 1
*Oct 18 23:09:04.763: DUAL: dest(10.0.0.0/8) active
*Oct 18 23:09:04.763: DUAL: rcvreply: 10.0.0.0/8 via 172.16.1.6 metric 4294967295/4294967295
*Oct 18 23:09:04.763: DUAL: reply count is 1
*Oct 18 23:09:04.763: DUAL: Clearing handle 1, count now 0
*Oct 18 23:09:04.763: DUAL: Freeing reply status table
*Oct 18 23:09:04.763: DUAL: Find FS for dest 10.0.0.0/8. FD is 4294967295, RD is 4294967295 found
*Oct 18 23:09:04.763: DUAL: Removing dest 10.0.0.0/8, nexthop 172.16.1.1
*Oct 18 23:09:04.763: DUAL: Removing dest 10.0.0.0/8, nexthop 172.16.1.6
*Oct 18 23:09:04.763: DUAL: No routes. Flushing dest 10.0.0.0/8
经过如上配置后,可以发现R2不再接收到关于 10.1.1 .0/24的网络的查询包。仅仅有关于10.0.0.0/8网络的本地查询包被发出。因此使用汇总和stub可以有效的避免路由出现SIA状态,同时解决了EIGRP的路由收敛问题,以保证EIGRP的收敛变得简单可行。
至此,实验完成。