天天看點

EIGRP鄰居關系

1.實驗目的 

通過EIGRP鄰居建立的相關實驗,學習到如何調整EIGRP的HELLO和HOLD時間,使用

被動接口阻止不必要的鄰居關系,認證EIGRP鄰居,靜态鄰居的配置以及哪些參數影響EIGRP

鄰居建立。 

2. 實驗拓撲 

3. 實驗步驟 

1. 首先在R1,R2,R3相關接口配置好IP位址,并且各自配置一個環回口,R1的環

回口loopback 0位址為1.1.1.1/24,R2的環回口loopback 0位址為2.2.2.2/24,依

次類推。注意保證直連接配接口的連通性。 

2. 在R1和R2上分别配置EIGRP 100,并且将各自相關接口加入EIGRP程序中,互相

學習到路由。 

R1(config)#router eigrp 100 

R1(config-router)#no auto-summary  

R1(config-router)#network 1.1.1.0 0.0.0.255 

R1(config-router)#network 10.10.12.0 0.0.0.255 

R2(config)#router eigrp 100 

R2(config-router)#no auto-summary  

R2(config-router)#network 2.2.2.0 0.0.0.255 

R2(config-router)#network 10.10.12.0 0.0.0.255 

R2(config-router)# 

*Mar  1 00:02:52.587: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 10.10.12.1 

(Ethernet0/1) is up: new adjacency    //日志顯示鄰居正常建立 

3. 在R1上,更改對于R2的EIGRP的Hello和hold時間。 

R1(config)#int e0/0 

R1(config-if)#ip hello-interval eigrp 100 3  //将Hello時間更改為3s 

R1(config-if)#ip hold-time eigrp 100 9  //将Hold時間更改為9s 

4. 在R1上使用指令show ip eigrp interfaces detail可以驗證hello時間已經被更改為

3s。 

 同時在R2上使用指令show ip eigrp neighbor可以檢視到R1的hold時間。 

最大為8s,則hold時間被更改為9s。 

5. 要求R1路由表需要10.10.23.0/24的路由,是以R2上可以加入一條network指令。 

R2(config-router)#network 10.10.23.0 0.0.0.255 

R2(config-router)#exit 

但是一旦加入該指令,就會使得R2的E0/0接口加入EIGRP 100程序,會正常收

發EIGRP的Hello包。為了阻止R2和R3建立鄰居,我們可以使用被動接口

(passive-interface),其原理就是被動接口不發送Hello包,進而無法正常建立鄰

居關系。 

6. 将R2的E0/0接口設定為被動接口。 

R2(config-router)#passive-interface e0/0  //将E0/0設定為被動接口 

通過指令debug eigrp packets hello我們可以發現,R2确實沒有在E0/0接口發送

Hello包。 

R2#debug eigrp packets hello  

EIGRP Packets debugging is on 

(HELLO) 

     *Mar  1 00:21:36.311: EIGRP: Sending HELLO on Ethernet0/1 

*Mar  1 00:21:36.311:   AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 

*Mar  1 00:21:36.615: EIGRP: Received HELLO on Ethernet0/1 nbr 10.10.12.1 

*Mar  1 00:21:36.619:   AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ 

un/rely 0/0 

  還存在另一種配置形式。 

R2(config-router)#passive-interface default  //使所有接口成為被動接口 

R2(config-router)#no passive-interface e0/1  //開啟所需要的非被動接口 

7. 為R1和R2配置EIGRP認證。 

首先需要在各自路由器上配置key chain(鑰匙串),然後定義鑰匙串上的鑰匙,以

編号來區分。 

R1(config)#key chain CCNP 

R1(config-keychain)#key 1 

R1(config-keychain-key)#key-string CCNP 

上述步驟定義了一個名為CCNP的鑰匙串,并且該鑰匙串上編号為1的鑰匙為

CCNP。 

R1(config-keychain-key)#?    

Key-chain key configuration commands: 

  accept-lifetime  Set accept lifetime of key 

  default          Set a command to its defaults 

  exit             Exit from key-chain key configuration mode 

  key-string       Set key string 

  no               Negate a command or set its defaults 

  send-lifetime    Set send lifetime of key 

還可以通過可選項accept-lifetime和send-lifetime來設定該編号鑰匙的接受和發送

時間,進而達到根據不同時間采用不同編号鑰匙的目的。(這裡對于基于時間變換

鑰匙的實驗就不驗證了) 

然後在需要認證的接口啟用EIGRP認證,并且關聯到相關的key chain上。 

R1(config-if)#ip authentication mode eigrp 100 md5  //開啟EIGRP的MD5認證 

R1(config-if)#ip authentication key-chain eigrp 100 CCNP  //認證材料為鑰匙串

CCNP 

*Mar  1 00:33:54.083: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 10.10.12.2 

(Ethernet0/0) is down: authentication mode changed 

由于R2目前尚未配置認證資訊,是以R1和R2的鄰居關系down掉。 

在R2上配置一個鑰匙串,配置好相關編号鑰匙,并且在相應接口啟用。 

R2(config)#key chain CCNA  //R2上的鑰匙串名為CCNA 

R2(config-keychain)#key 1  //鑰匙編号依然為1 

R2(config-keychain-key)#key-string CCNP  //内容一緻,為CCNP 

R2(config-keychain-key)#exit 

R2(config-keychain)#exit 

R2(config)#int e0/1 

R2(config-if)#ip authentication mode eigrp 100 md5  

R2(config-if)#ip authentication key-chain eigrp 100 CCNA  

R2(config-if)# 

*Mar  1 00:38:28.415: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 10.10.12.1 

(Ethernet0/1) is up: new adjacency  //鄰居重新正常建立。 

通過上述實驗可以總結出,EIGRP支援MD5密文認證,并且依靠鑰匙串的支援。

同時在認證的過程中,鑰匙串的名稱隻是本地起效的,雙方不需要一緻,但鑰匙

編号和鑰匙内容必須要一緻! 

8. 在某些不支援多點傳播或者廣播的鍊路上時,如果需要建立EIGRP鄰居,那麼可以采

用單點傳播方式。這個時候就需要靜态的指定鄰居。 

要求R2和R3之間通過靜态指定鄰居的方式建立鄰居。 

首先删去之前R2上被passive掉的接口。 

R2(config-router)#no passive-interface e0/0 

然後在R2上靜态的指定R3作為其鄰居。 

R2(config-router)#neighbor 10.10.23.3 e0/0  //注意,該指令所指鄰居必須和自己

在同一子網,并且需要給出接口。 

R3的配置如下: 

R3(config)#router eigrp 100 

R3(config-router)#no au 

R3(config-router)#network 10.10.23.0 0.0.0.255 

R3(config-router)#nei 10.10.23.2 e0/1 

*Mar  1 00:48:47.431: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 10.10.23.2 

(Ethernet0/1) is up: new adjacency  //鄰居成功建立。 

通過如下指令可以驗證該鄰居為靜态鄰居。 

如果在某個接口指定了靜态鄰居,那麼該接口的動态鄰居将會全部丢失! 

9. 總結上述實驗,影響EIGRP鄰居建立的相關參數有:  

l 兩台路由器能夠互相通信 

l AS号必須一緻 

l Hello和Hold間隔不影響鄰居建立 

l 如果有認證,認證必須一緻 

l 度量計算的K值必須一緻(将在下一實驗中詳細介紹) 

10. 如果在一些帶寬有限的WAN網絡上,可以限制EIGRP使用帶寬的額度。 

在R1的E0/0接口上,配置帶寬為10000K,EIGRP 100能夠使用其中的10%。 

R1(config-if)#bandwidth 10000  //首先必須設定一個參考值進行計算 

R1(config-if)#ip bandwidth-percent eigrp 100 ? 

  <1-999999>  Maximum bandwidth percentage that EIGRP may use  

R1(config-if)#ip bandwidth-percent eigrp 100 10  //EIGRP 100使用參考值的10% 

吳迪

2017.12.2

繼續閱讀