EIGRP邻居关系

简介:

1.实验目的 

通过EIGRP邻居建立的相关实验,学习到如何调整EIGRP的HELLO和HOLD时间,使用

被动接口阻止不必要的邻居关系,认证EIGRP邻居,静态邻居的配置以及哪些参数影响EIGRP

邻居建立。 

 

2. 实验拓扑 

 blob.png 


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。 

  blob.png    

 同时在R2上使用命令show ip eigrp neighbor可以查看到R1的hold时间。 

  

blob.png

最大为8s,则hold时间被更改为9s。 

 

5. 要求R1路由表需要10.10.23.0/24的路由,因此R2上可以加入一条network命令。 

R2(config)#router eigrp 100 

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 eigrp 100 

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 eigrp 100 

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)#int e0/0 

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 eigrp 100 

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  //邻居成功建立。 

 

通过如下命令可以验证该邻居为静态邻居。 

 blob.png

 

如果在某个接口指定了静态邻居,那么该接口的动态邻居将会全部丢失! 

 

9. 总结上述实验,影响EIGRP邻居建立的相关参数有:  

l 两台路由器能够相互通信 

l AS号必须一致 

l Hello和Hold间隔不影响邻居建立 

l 如果有认证,认证必须一致 

l 度量计算的K值必须一致(将在下一实验中详细介绍) 

 

10. 如果在一些带宽有限的WAN网络上,可以限制EIGRP使用带宽的额度。 

在R1的E0/0接口上,配置带宽为10000K,EIGRP 100能够使用其中的10%。 

R1(config)#int e0/0 

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

 

本文转自 新网学会 51CTO博客,原文链接:http://blog.51cto.com/xwxhvip/2046795 ,如需转载请自行联系原作者

相关文章
|
6月前
|
网络协议
【HCIP】05.OSPF邻居与邻接关系
【HCIP】05.OSPF邻居与邻接关系
25 0
|
1月前
|
网络协议 vr&ar 网络架构
1. OSPF 基础实验(三):邻接关系和 LSA
设备互联方式及 IP 地址规划如图所示,其中 R1 的 Loopback0 接口属于 OSPF 区域 2,R4的GE0/0/2 接口属于 OSPF 区域1,R1、R2、R3、R4 的其他接口都属于 OSPF 区域 0。R5 的 GE0/0/3 属于 OSPF 区域 1,R5 的 Loopback0 不属于 OSPF 域内。
60 2
|
网络架构
内部BGP邻居(下)
文章目录 系列文章 实验目的 实验拓扑 实验步骤 步骤1的配置 步骤2的配置 步骤3的配置 步骤4的配置
94 0
内部BGP邻居(下)
|
网络架构
内部BGP邻居(上)
文章目录 系列文章 实验目的 实验拓扑 实验步骤 步骤1的配置 步骤2的配置 步骤3的配置 步骤4的配置
124 0
内部BGP邻居(上)
|
网络协议 数据库 网络架构
|
网络协议 网络架构
|
网络协议 网络架构