EIGRP 有三个管理距离:

内部路由:90

外部路由:170

汇总路由:5

关于汇总路由为什么要设置为AD=5,没有什么资料记载,我是在论坛上问人,还有去查看国外的论坛才知道它的作用的。

以下做实验看效果:


EIGRP 汇总路由的管理距离_interface



  1. R1:

  2. interface Loopback0

  3. ip address 172.16.1.1 255.255.255.0

  4. !

  5. interface Loopback2

  6. ip address 172.16.2.1 255.255.255.0

  7. !

  8. interface Serial0/0

  9. ip address 45.1.1.4 255.255.255.0

  10. ip summary-address eigrp 10 172.16.0.0 255.255.0.0 5 <<--这里有个5,是默认的值

  11. serial restart-delay 0

  12. !

  13. router eigrp 10

  14. network 0.0.0.0

  15. no auto-summary


  1. R5:

  2. interface Serial0/0

  3. ip address 45.1.1.5 255.255.255.0

  4. serial restart-delay 0

  5. !          

  6. router eigrp 10

  7. network 0.0.0.0

  8. auto-summary

cisco将eigrp的汇总路由的AD值默认设置5,但是奇怪的是,我们在R5中看:


EIGRP 汇总路由的管理距离_ip_02


却仍然显示的是90.这是因为汇总路由的AD值是本地有效的,只能在R4中:


EIGRP 汇总路由的管理距离_ip_03


为什么是本地有效?为什么要是5?

原因很简单:为了防止路由环路。

        如果将从外部发来的跟我们汇总的路由一样的路由,AD=5可以保证它可以不被替代,可以放进路由表,因为除了静态路由,和直边的,5几乎是最小的AD了。这是为了确保本路由器能将汇总地址放进路由表的

路由决策,所以只是本地有效,不需要传递出去。

我模拟了一个实验环境:


EIGRP 汇总路由的管理距离_address_04

在R2重发布ospf的路由:172.16.0.0/16进来,自身也汇总路由:172.16.0.0/16,但是我们手工将AD设置为200,看路由环路的现象。


  1. R1:



  2. !

  3.   interface Serial0/0

  4. ip address 12.1.1.1 255.255.255.0

  5. serial restart-delay 0

  6. !

  7. router ospf 10

  8. log-adjacency-changes

  9. redistribute static metric 100 subnets network 0.0.0.0 255.255.255.255 area 0

  10. !    

  11. ip route 172.16.0.0 255.255.0.0 Serial0/0      



  1. R2:

  2. interface Loopback0

  3. ip address 172.16.1.1 255.255.255.0

  4. !

  5. interface Loopback1

  6. ip address 172.16.2.1 255.255.255.0

  7. !

  8. interface Serial0/0

  9. ip address 12.1.1.2 255.255.255.0

  10. serial restart-delay 0

  11. !

  12. interface Serial0/1

  13. ip address 23.1.1.2 255.255.255.0

  14. ip summary-address eigrp 10 172.16.0.0 255.255.0.0 200  <<--注意这个200

  15. serial restart-delay 0

  16. !

  17. router eigrp 10

  18. redistribute ospf 10 metric 1500 100 255 1 1500

  19. network 23.1.1.2 0.0.0.0

  20. network 172.16.0.0

  21. no auto-summary

  22. !

  23. router ospf 100

  24. log-adjacency-changes

  25. network 12.1.1.2 0.0.0.0 area 0

  26. !



  1. R3:

  2. !



  3. interface Serial0/0

  4. ip address 23.1.1.3 255.255.255.0

  5. serial restart-delay 0

  6. !

  7. router eigrp 10

  8. network 0.0.0.0

  9. auto-summary

接着我们看R2的路由表:



EIGRP 汇总路由的管理距离_address_05






在eigrp汇总路由时,会生成一条172.16.0.0/16的AD为200的路由,但是因为从ospf重发布进来的AD是170,所以

放进路由表的是从ospf重发布进来的路由。

现在我们将AD修改回5:


  1. R2:

  2. r2(config-if)#ip summary-address  eigrp  10 172.16.0.0 255.255.0.0 5

这里看路由表:


EIGRP 汇总路由的管理距离_interface_06


这时就不会发生环路了.


本文出自 “YEELONⒼ ” 博客,请务必保留此出处http://yeelone.blog.51cto.com/1476571/482533