眾所周知,Router-ID在OSPF這樣的鏈路狀態(tài)路由協(xié)議中的作用是巨大的,DR/BDR的選舉都是依靠RID來(lái)進(jìn)行的,但是今天看書(shū)發(fā)現(xiàn)Router-ID在EIGRP中同樣存在,只是平時(shí)都沒(méi)有怎么用過(guò),它的作用是什么呢?
經(jīng)過(guò)一番研究,可以得到以下2個(gè)結(jié)論:
1、EIGRP中的Router-ID選舉規(guī)則同OSPF一樣,有Loopback接口先選Loopback接口,沒(méi)有的話再選擇當(dāng)前最大的活躍接口,當(dāng)然,通過(guò) eigrp router-id 命令指定的Router-ID最優(yōu)先。
2、EIGRP中的Router-ID起到的也是標(biāo)記作用,這在解決重分布路由導(dǎo)致環(huán)路問(wèn)題上起到了重要的作用??梢赃@樣理解,當(dāng)一臺(tái)運(yùn)行EIGRP的路由器收到一個(gè)外部路由更新,發(fā)現(xiàn)這條路由更新的起源Router-ID與自己的Router-ID相同,那么它將會(huì)忽略這條路由更新,避免產(chǎn)生環(huán)路。
下面利用一個(gè)實(shí)驗(yàn)來(lái)觀察這個(gè)現(xiàn)象:
【實(shí)驗(yàn)環(huán)境】
C3640-IK9O3S-M Version 12.4(10)
【實(shí)驗(yàn)拓?fù)洹?/span>
【實(shí)驗(yàn)描述】
R1回環(huán)接口1.1.1.1
R2、R3回環(huán)接口2.2.2.2
R1、R2跑RIP
R2、R3跑EIGRP 110
在R2上將RIP重分布進(jìn)EIGRP
【實(shí)驗(yàn)步驟】
1、R1基本配置
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
!
router rip
version 2
network 1.0.0.0
network 12.0.0.0
!
2、R2基本配置
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 12.12.12.2 255.255.255.0
!
interface FastEthernet1/0
ip address 23.23.23.2 255.255.255.0
!
router eigrp 110
redistribute rip metric 100000 1000 255 1 1500
network 23.23.23.0 0.0.0.255
no auto-summary
!
router rip
version 2
network 12.0.0.0
!
3、R3基本配置
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 23.23.23.3 255.255.255.0
!
router eigrp 110
network 23.23.23.0 0.0.0.255
no auto-summary
!
【實(shí)驗(yàn)結(jié)果】
R3#sh ip route
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, FastEthernet0/0
R3上沒(méi)有收到重分布進(jìn)來(lái)的RIP路由信息(關(guān)于1.0.0.0網(wǎng)段)
R2#sh ip eigrp topology
IP-EIGRP Topology Table for AS(110)/ID(2.2.2.2)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 1.0.0.0/8, 1 successors, FD is 281600
via Redistributed (281600/0)
P 12.12.12.0/24, 1 successors, FD is 281600
via Redistributed (281600/0)
P 23.23.23.0/24, 1 successors, FD is 28160
via Connected, FastEthernet1/0
可以看到R2的拓?fù)浔碇惺谴嬖?.0.0.0/8這條路由更新的,而且也是重分布進(jìn)來(lái)的
R2#sh ip eigrp topology 1.0.0.0
IP-EIGRP (AS 110): Topology entry for 1.0.0.0/8
State is Passive, Query origin flag is 1, 1 Successor(s), FD is 281600
Routing Descriptor Blocks:
12.12.12.1, from Redistributed, Send flag is 0x0
Composite metric is (281600/0), Route is External
Vector metric:
Minimum bandwidth is 100000 Kbit
Total delay is 10000 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 0
External data:
Originating router is 2.2.2.2 (this system)
AS number of route is 0
External protocol is RIP, external metric is 1
Administrator tag is 0 (0x00000000)
仔細(xì)觀察這條路由更新,可以看到它的起源RID是2.2.2.2(其實(shí)就是自己)
下面我們看看在R3上發(fā)生了什么:
R3#sh ip eigrp event
Event information for AS 110:
1 00:00:08.691 Ignored route, metric: 1.0.0.0 284160
2 00:00:08.691 Ignored route, neighbor info: 23.23.23.2 Loopback0
3 00:00:08.691 Ignored route, dup router: 2.2.2.2
4 00:00:08.691 Ignored route, metric: 12.12.12.0 284160
5 00:00:08.691 Ignored route, neighbor info: 23.23.23.2 Loopback0
6 00:00:08.691 Ignored route, dup router: 2.2.2.2
可以看到,R3忽略了1.0.0.0和12.12.12.0的路由更新,原因是這些路由更新的起源RID與自己的RID相同了,為了避免產(chǎn)生環(huán)路,因此R3忽略了它們。
由此可以看到EIGRP中的Router-ID的作用了。