EIGRP 有三个管理距离:web
内部路由:90redis
外部路由:170ide
汇总路由:5oop
关于汇总路由为何要设置为AD=5,没有什么资料记载,我是在论坛上问人,还有去查看国外的论坛才知道它的做用的。spa
如下作实验看效果:3d
- R1:
- interface Loopback0
- ip address 172.16.1.1 255.255.255.0
- !
- interface Loopback2
- ip address 172.16.2.1 255.255.255.0
- !
- interface Serial0/0
- ip address 45.1.1.4 255.255.255.0
- ip summary-address eigrp 10 172.16.0.0 255.255.0.0 5 <<--这里有个5,是默认的值
- serial restart-delay 0
- !
- router eigrp 10
- network 0.0.0.0
- no auto-summary
- R5:
- interface Serial0/0
- ip address 45.1.1.5 255.255.255.0
- serial restart-delay 0
- !
- router eigrp 10
- network 0.0.0.0
- auto-summary
cisco将eigrp的汇总路由的AD值默认设置5,可是奇怪的是,咱们在R5中看:rest
却仍然显示的是90.这是由于汇总路由的AD值是本地有效的,只能在R4中:orm
为何是本地有效?为何要是5?router
缘由很简单:为了防止路由环路。xml
若是将从外部发来的跟咱们汇总的路由同样的路由,AD=5能够保证它能够不被替代,能够放进路由表,由于除了静态路由,和直边的,5几乎是最小的AD了。这是为了确保本路由器能将汇总地址放进路由表的
路由决策,因此只是本地有效,不须要传递出去。
我模拟了一个实验环境:
在R2重发布ospf的路由:172.16.0.0/16进来,自身也汇总路由:172.16.0.0/16,可是咱们手工将AD设置为200,看路由环路的现象。
- R1:
- !
- interface Serial0/0
- ip address 12.1.1.1 255.255.255.0
- serial restart-delay 0
- !
- router ospf 10
- log-adjacency-changes
- redistribute static metric 100 subnets network 0.0.0.0 255.255.255.255 area 0
- !
- ip route 172.16.0.0 255.255.0.0 Serial0/0
- R2:
- interface Loopback0
- ip address 172.16.1.1 255.255.255.0
- !
- interface Loopback1
- ip address 172.16.2.1 255.255.255.0
- !
- interface Serial0/0
- ip address 12.1.1.2 255.255.255.0
- serial restart-delay 0
- !
- interface Serial0/1
- ip address 23.1.1.2 255.255.255.0
- ip summary-address eigrp 10 172.16.0.0 255.255.0.0 200 <<--注意这个200
- serial restart-delay 0
- !
- router eigrp 10
- redistribute ospf 10 metric 1500 100 255 1 1500
- network 23.1.1.2 0.0.0.0
- network 172.16.0.0
- no auto-summary
- !
- router ospf 100
- log-adjacency-changes
- network 12.1.1.2 0.0.0.0 area 0
- !
- R3:
- !
- interface Serial0/0
- ip address 23.1.1.3 255.255.255.0
- serial restart-delay 0
- !
- router eigrp 10
- network 0.0.0.0
- auto-summary
接着咱们看R2的路由表:
在eigrp汇总路由时,会生成一条172.16.0.0/16的AD为200的路由,可是由于从ospf重发布进来的AD是170,因此
放进路由表的是从ospf重发布进来的路由。
如今咱们将AD修改回5:
- R2:
- r2(config-if)#ip summary-address eigrp 10 172.16.0.0 255.255.0.0 5
这里看路由表:
这时就不会发生环路了.