一.测试拓扑备注:---为了测试效果,在R2路由器上设置为EIGRP Stub路由器测试总结:1.EIGRP路由器不会向Stub邻居发出查询报文,但是Stub会向自己邻居发查询报文
2.如果stub不跟任何参数,默认会自己增加connected和summary两个参数
3.stube的参数除receive-only只能单独使用外,其他都能任意搭配使用
---不过static是redistributed的子集,虽然可以搭配,没有实际意义4.leak-map参数是否能单独使用,不同的路由器不一样,测试的路由器不能单独使用
二.基本配置
1.R1路由器hostname R1
interface Loopback0
ip address 1.1.1.1 255.255.255.0
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0
no shutdown
router eigrp 10
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
passive-interface Loopback0
no auto-summary
2.R2路由器hostname R2
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
no shutdown
interface FastEthernet1/0
ip address 23.1.1.2 255.255.255.0
no shutdown
router eigrp 10
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
no auto-summary
3.R3路由器hostname R3
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface FastEthernet0/0
ip address 23.1.1.3 255.255.255.0
no shutdown
router eigrp 10
network 3.3.3.3 0.0.0.0
network 13.1.1.3 0.0.0.0
passive-interface Loopback0
no auto-summary
三.Stub基本测试
1.R2没有设置stub路由器,R1会向其发出查询报文①在R2开启debug eigrp packets query reply
②R1上shutdown l0接口R1(config)#interface l0
R1(config-if)#shutdown
③在R2上可以看到R2收到R1的查询报文之后,没有立即回复,而是向R3发出查询报文,得到回复之后,才给R1回复R2(config)#
*Feb 8 04:01:09.647: EIGRP: Received QUERY on Fa0/0 - paklen 44 nbr 12.1.1.1
*Feb 8 04:01:09.647: AS 10, Flags 0x0:(NULL), Seq 14/0 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Feb 8 04:01:09.659: EIGRP: Enqueueing QUERY on Fa1/0 - paklen 0 tid 0 iidbQ un/rely 0/1 serno 22-22
*Feb 8 04:01:09.659: EIGRP: Enqueueing QUERY on Fa0/0 - paklen 0 tid 0 iidbQ un/rely 0/1 serno 22-22
*Feb 8 04:01:09.663: EIGRP: Sending QUERY on Fa1/0 - paklen 44 tid 0
*Feb 8 04:01:09.663: AS 10, Flags 0x0:(NULL), Seq 28/0 interfaceQ 0/0 iidbQ un/rely 0/0 serno 22-22
*Feb 8 04:01:09.691: EIGRP: Received REPLY on Fa1/0 - paklen 44 nbr 23.1.1.3
*Feb 8 04:01:09.691: AS 10, Flags 0x0:(NULL), Seq 11/28 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Feb 8 04:01:09.703: EIGRP: Enqueueing REPLY on Fa0/0 - paklen 0 nbr 12.1.1.1 tid 0 iidbQ un/rely 0/1 peerQ un/rely 0/0 serno 23-23
*Feb 8 04:01:09.711: EIGRP: Sending REPLY on Fa0/0 - paklen 44 nbr 12.1.1.1 tid 0
*Feb 8 04:01:09.711: AS 10, Flags 0x0:(NULL), Seq 30/14 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 23-23
2.如果只敲stub会默认跟着connected summary
①R2设置stub路由器,只配置stub不跟任何参数R2(config)#router eigrp 10
R2(config-router)#eigrp stub
②通过查看配置,可以看到会默认跟上connected summaryR2(config-router)#do show run | sec router
router eigrp 10
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
eigrp stub connected summary
R2(config-router)#
3.EIGRP不会向stub邻居发出查询报文,但是妨碍Stub向其邻居发出查询报文
①在R1和R2上都开启debug eigrp packets query reply
②R1上shutdown l0接口R1(config)#interface l0
R1(config-if)#shutdown
③R1上可以看到,R2发出的查询报文R1(config-if)#
*Feb 8 04:14:45.467: EIGRP: Received QUERY on Fa0/0 - paklen 44 nbr 12.1.1.2
*Feb 8 04:14:45.467: AS 10, Flags 0x0:(NULL), Seq 45/0 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Feb 8 04:14:45.483: EIGRP: Enqueueing REPLY on Fa0/0 - paklen 0 nbr 12.1.1.2 tid 0 iidbQ un/rely 0/1 peerQ un/rely 0/0 serno 30-30
*Feb 8 04:14:45.491: EIGRP: Sending REPLY on Fa0/0 - paklen 44 nbr 12.1.1.2 tid 0
*Feb 8 04:14:45.491: AS 10, Flags 0x0:(NULL), Seq 23/45 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 30-30
④在R2上可以看到,R2同时给R1和R3发出查询报文R2(config-router)#
*Feb 8 04:14:45.355: EIGRP: Enqueueing QUERY on Fa1/0 - paklen 0 tid 0 iidbQ un/rely 0/1 serno 29-29
*Feb 8 04:14:45.355: EIGRP: Enqueueing QUERY on Fa0/0 - paklen 0 tid 0 iidbQ un/rely 0/1 serno 29-29
*Feb 8 04:14:45.359: EIGRP: Sending QUERY on Fa1/0 - paklen 44 tid 0
*Feb 8 04:14:45.359: AS 10, Flags 0x0:(NULL), Seq 44/0 interfaceQ 0/0 iidbQ un/rely 0/0 serno 29-29
*Feb 8 04:14:45.359: EIGRP: Sending QUERY on Fa0/0 - paklen 44 tid 0
*Feb 8 04:14:45.359: AS 10, Flags 0x0:(NULL), Seq 45/0 interfaceQ 0/0 iidbQ un/rely 0/0 serno 29-29
*Feb 8 04:14:45.387: EIGRP: Received REPLY on Fa1/0 - paklen 44 nbr 23.1.1.3
*Feb 8 04:14:45.387: AS 10, Flags 0x0:(NULL), Seq 17/44 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Feb 8 04:14:45.399: EIGRP: Received REPLY on Fa0/0 - paklen 44 nbr 12.1.1.1
*Feb 8 04:14:45.399: AS 10, Flags 0x0:(NULL), Seq 23/45 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
⑤从R1的f0/0抓包可以看出,是R1先发出update报文,R2回复确认报文之后,才发出查询报文--从抓包也可以看出,Update、Query、Reply报文都需要ack确认四.Stub不同参数测试---用的是dynamips c7200-advipservicesk9-mz.152-4.S2.image,不同的版本可能结果不一样1.stub不跟任何参数,默认会跟上connected summary参数,会传递直连和汇总路由
①在R1上面能看到R2的直连路由R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/156160] via 12.1.1.2, 00:03:21, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
D 23.1.1.0 [90/30720] via 12.1.1.2, 00:03:21, FastEthernet0/0
R1#
②R2开启自动汇总,R1上能收到汇总路由R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
D 2.0.0.0/8 [90/156160] via 12.1.1.2, 00:00:06, FastEthernet0/0
D 23.0.0.0/8 [90/30720] via 12.1.1.2, 00:00:06, FastEthernet0/0
R1#
③R2关闭自动汇总,配置手工汇总,R1上也能收到手工汇总路由R2(config)# router eigrp 10
R2(config-router)# no auto-summary
R2(config-router)#int f0/0
R2(config-if)#ip summary-address eigrp 10 3.0.0.0/8
R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/156160] via 12.1.1.2, 00:00:27, FastEthernet0/0
D 3.0.0.0/8 [90/158720] via 12.1.1.2, 00:00:06, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
D 23.1.1.0 [90/30720] via 12.1.1.2, 00:00:27, FastEthernet0/0
R1#
2.如果stub只跟connected参数,则只会传递直连路由R2(config)# router eigrp 10
R2(config-router)# eigrp stub connected
R2(config-router)#do show run | sec router
router eigrp 10
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
eigrp stub connected
R2(config-router)#int f0/0
R2(config-if)#ip summary-address eigrp 10 3.0.0.0/8
R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/156160] via 12.1.1.2, 00:01:01, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
D 23.1.1.0 [90/30720] via 12.1.1.2, 00:01:01, FastEthernet0/0
R1#
3.如果stub只跟summary参数,则只会传递汇总路由R2(config)# router eigrp 10
R2(config-router)# eigrp stub summary
R2(config-router)#do show run | sec router
router eigrp 10
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
eigrp stub summary
R2(config-router)#int f0/0
R2(config-if)#ip summary-address eigrp 10 3.0.0.0/8
R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
D 3.0.0.0/8 [90/158720] via 12.1.1.2, 00:00:05, FastEthernet0/0
R1#
4.如果stub只跟static 参数,则只会传递重分布的静态路由R2(config)#ip route 100.1.1.0 255.255.255.0 l0
R2(config)# router eigrp 10
R2(config-router)#redistribute static
R2(config-router)# eigrp stub static
R2(config-router)#do show run | sec router
router eigrp 10
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
redistribute static
eigrp stub static
R2(config-router)#int f0/0
R2(config-if)#ip summary-address eigrp 10 3.0.0.0/8
R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
100.0.0.0/24 is subnetted, 1 subnets
D EX 100.1.1.0 [170/156160] via 12.1.1.2, 00:01:27, FastEthernet0/0
R1#
5.如果stub只跟redistributed参数,则会传递所有重分布的路由,包括静态路由①R2上配置静态路由、RIP和手工汇总ip route 100.1.1.0 255.255.255.0 l0
interface Loopback1
ip address 10.10.10.10 255.255.255.0
router rip
version 2
network 10.0.0.0
no auto-summary
int f0/0
ip summary-address eigrp 10 3.0.0.0/8
②R2上配置重分发和只带 redistributed的stubrouter eigrp 10
redistribute static
redistribute rip metric 10000 1000 15 1 1500
eigrp stub redistributed
R2(config-router)#do show run | sec router
router eigrp 10
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
redistribute static
redistribute rip metric 10000 1000 15 1 1500
eigrp stub redistributed
备注:
低版本可能redistributed不能单独使用,测试的IO可以单独使用。③在R1上面既能看到重分布进来的静态路由,也有重分布进来的RIP路由R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
D EX 10.10.10.0 [170/514560] via 12.1.1.2, 00:00:28, FastEthernet0/0
100.0.0.0/24 is subnetted, 1 subnets
D EX 100.1.1.0 [170/156160] via 12.1.1.2, 00:00:28, FastEthernet0/0
R1#
6.stub的receive-only参数只能单独使用,它表示只收路由条目R2(config)#ip route 100.1.1.0 255.255.255.0 l0
R2(config)# router eigrp 10
R2(config-router)#redistribute static
R2(config-router)# eigrp stub receive-only
R2(config-router)#do show run | sec router
router eigrp 10
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
redistribute static
eigrp stub receive-only
R2(config-router)#int f0/0
R2(config-if)#ip summary-address eigrp 10 3.0.0.0/8
R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
R1#
7.stub的leak-map参数不能单独使用,如果只配置leak-map会默认跟上connected summary参数备注:
有的版本leak-map参数能单独使用,测试的IO不能单独使用,手工可以跟除receive-only之外其他任意参数。①R2配置ACL和route-mapaccess-list 10 permit 3.3.3.0
route-map stub-leakmap permit 10
match ip address 10
②R2配置配置stub只带leak-map参考,查看配置会自动加上connected summary参数R2(config)#router eigrp 10
R2(config-router)#eigrp stub leak-map stub-leakmap
R2(config-router)#do show run | sec router
router eigrp 10
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 23.1.1.2 0.0.0.0
eigrp stub connected summary leak-map stub-leakmap
③在R1上能看到不仅有直连路由还有从R3学习到的路由R1#show ip route eigrp | begin Gate
Gateway of last resort is not set
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/156160] via 12.1.1.2, 00:03:35, FastEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/158720] via 12.1.1.2, 00:03:34, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
D 23.1.1.0 [90/30720] via 12.1.1.2, 00:03:35, FastEthernet0/0
R1#