请选择 进入手机版 | 继续访问电脑版

设为首页 收藏本站
思科社区 关注
思科社区

搜索
热搜: 邮件服务器
查看: 247|回复: 2

【原创】EIGRP的Stub特性测试

[复制链接]
发表于 2020-2-9 15:45:57 | 显示全部楼层 |阅读模式
一.测试拓扑

备注:
---为了测试效果,在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 summary
R2(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的stub
router 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-map
access-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#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分5 (1 评价)
发表于 2020-2-10 11:27:00 | 显示全部楼层
感谢楼主分享,谢谢~
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
发表于 7 天前 | 显示全部楼层
感谢楼主分享,学到了不少
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
您需要登录后才可以回帖 思科 CCO 登录 | 思科 CCO 注册   

本版积分规则

Archiver | 思科社区  

GMT+8, 2020-2-18 18:40 , Processed in 0.092183 second(s), 37 queries .

京ICP备09041801号-187

版权所有 :copyright:1992-2019 思科系统  重要声明 | 保密声明 | 隐私权政策 | 商标 |

快速回复 返回顶部 返回列表