实验2:EIGRP邻居关系


EIGRP实验目的


通过邻居的建立,学习到如何调整EIGRP的HELLO与HOLD时间,使用被动接口阻止不必要的邻居关系,认证EIGRP邻居。静态邻居的配置以及哪些参数影响EIGRP的邻居建立。


实验拓扑:

wKioL1PDt0PS_3p9AACq809FS0c811.jpg


实验步骤:


1、首先在R1、R2、R3接口配置好相关的IP地址,并且各自配置一个回环口,注意它们的互通。


R1:12.1.1.1/24

LO 0:1.1.1.1/24


R2:12.1.1.2/24  >>E0口

  23.1.1.2/24    >>E1口

  lo 0:2.2.2.2/24


R3:23.1.1.3

lo 0:3.3.3.3/24


步骤如下:

----------------------------------------------------

R1#conf t

R1(config)#no ip domain lo

R1(config)#lin con 0

R1(config-line)#exec-t 0 0

R1(config-line)#logg sy

R1(config-line)#exit

R1(config)#int lo 0

R1(config-if)#ip add 1.1.1.1 255.255.255.0 (这里配置回环口的IP地址 1.1.1.1)

R1(config-if)#exit

R1(config)#int e0/0

R1(config-if)#ip add 12.1.1.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#exit

R1(config)#

----------------------------------------------------

R2做同样的操作

R2#conf t

R2(config)#no ip domain lo

R2(config)#lin con 0

R2(config-line)#exec-t 0 0

R2(config-line)#logg sy

R2(config-line)#exit

R2(config)#int lo 0

R2(config-if)#ip add 2.2.2.2 255.255.255.0

R2(config-if)#exit

R2(config)#int e0/1

R2(config-if)#ip add 12.1.1.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#int e0/0

R2(config-if)#ip add 23.1.1.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#exit

R2(config)#

----------------------------------------------------

R3也做同样的配置

R3#conf t

R3(config)#no ip domain lo

R3(config)#lin con 0

R3(config-line)#exec-t 0 0

R3(config-line)#logg sy

R3(config-line)#exit

R3(config)#int lo 0

R3(config-if)#ip add 3.3.3.3 255.255.255.0

R3(config-if)#exit

R3(config)#int e0/0

R3(config-if)#ip add 23.1.1.3 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#exit

R3(config)#

----------------------------------------------------

检验路由间的互通性,如下图

wKiom1PDt6mBONPvAAI5yehgvso603.jpg


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 12.1.1.0 0.0.0.255

R1(config-router)#exit


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 12.1.1.0 0.0.0.255

R2(config-router)#exit

----------------------------------------------------

EIGRP(100)建立成功如下图:

wKiom1PDt_6zd2mrAADcwzNTdEY560.jpg

3、在R1上,更改对于R2的EIGRP的   hello  与  hold   时间(相关命令如下)

----------------------------------------------------

R1(config)#int e0/0//改hello与hold要在接口里改,所以先进入要更改的接口里)

R1(config-if)#ip hell-interval eigrp 100 3//将hello时间更改为3 S

R1(config-if)#ip hold-time eigrp 100 9//将hold时间更改为9 S

----------------------------------------------------

4、在R1上使用命令:show ip eigrp interfaces datail可以验证hello时间已经更改为 3 S.

如下图:

wKioL1PDuKOycKCaAAOeROyq9AQ683.jpg

wKiom1PDuRmT1AKbAANYgtiAEGU982.jpg

同时也可以在R2上面使用命令:show ip eigrp neighbors 可以查看R1的hold时间。如下图

wKioL1PDuQ_zeHJAAAKjsBhzNdk822.jpg

注:默认情况下,EIGRP的HOLD时间为HELLO时间的三倍,但在实验中看到,只要HELLO时间比HOLD时间少,那么EIGRP就不会出现断线现象。(这个请自行测试,一般情况下,建议更改时还是按HOLD=HELLO*3来更改)

如下图:

wKioL1PDud6zJd7pAAEDiysznfI085.jpg

wKioL1PDuTnTVUMSAALb_l83-gM691.jpg

5、如果要求R1路由表中存在23.1.1.0/24的路由,因此可以在R2中把23段的在EIGRP中宣告即可,步骤如下:

----------------------------------------------------

R2(config)#router eigrp 100

R2(config-router)#network 23.1.1.0 0.0.0.255

R2(config-router)#exit

----------------------------------------------------

但是一旦加入了该命令,就会使得R2的E0/0接口加入了EIGRP 100进程,会正常的收发EIGRP的HELLO包。为了阻止R2与R3建立邻居关系,我们可以使用被动接口(passive-interfaces)

,其原理是被动接口不发送HELLO包,从而无法正常建立邻居关系。


6、将R2的E0/0接口更改成被动接口,命令如下:

----------------------------------------------------

R2(config)#router eigrp 100

R2(config-router)#passive-interface e0/0   //这里直接把E0/0接口配置成被动接口

----------------------------------------------------

----------------------------------------------------

R2(config)#router eigrp 100

R2(config-router)#passive-interface default   //使用所有接口默认为被动接口

R2(config-router)#no passive-interface e0/1  //开户非被动接口

----------------------------------------------------

如下图:

wKiom1PDua_wwdDxAAGSTf-avGo732.jpg

wKiom1PDudDj7z7iAAPfZ8oHfhU497.jpg

7、为R1与R2配置EIGRP的认证:

首先需要在各自路由器上面配置 key chain(钥匙串),然后定义钥匙串上去的钥匙,以编号为区分。命令如下:

----------------------------------------------------

R1(config)#key chain hzajie//这个本地有效

R1(config-keychain)#key 1//这个要双方一致

R1(config-keychain)#key-string CCNP//这个字符串要双方一致(大小写等)

----------------------------------------------------

配置好后,还要在接口上面起用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 hzajie //认证钥匙字符串为:hzajie

----------------------------------------------------

因认证是要双方的,所以还要在R2上面进行配置相同的认证。命令如下:

----------------------------------------------------

R2(config)#key-chain ccna

R2(config-keychain)#key 1

R2(config-keychain)#key-string CCNP

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

----------------------------------------------------

认证建立如下图:

wKiom1PEy5vRKpxIAALgM1XXYTo585.jpg

wKioL1PEy2zhHpWiAAGFYT1nVhU230.jpg

通过上述的实验我们可以总结出,EIGRP支持MD5认证,EIGRP支持MD5密文认证,并且依靠钥匙串的支持。同时在认证的过程中,钥匙串的名称只是本地有效,双方不需要一致,但是钥匙编号与钥匙的内容必须一致。

如下图:

wKiom1PEy8TCfd9oAAWbwjcDCoo075.jpg


8、实验总结:

   影响 EIGRP 邻居的建立的相关参数有:

1、两台路由器必须能相互通信

2、EIGRP的AS号必须一致。

3、HELLO与HOLD时间间隔不影响邻居的建立。

4、如果启用认证,认证必须一致。

5、度量计算的K值必须一致。