拓扑
配置
R1
R1(config)#router eigrp 100 使用编号为100 的AS启用EIGRP进程
R1(config-router)#network 192.168.10.0 0.0.0.255 宣告路由器上的网段
R1(config-router)#no auto-summary 关闭自动汇总
0.0.0.255 为通配符掩码(可理解为反掩码)
例如:255.255.255.252网段的通配符掩码为0.0.0.3
255.255.255.255 — 255.255.255.252 == 0.0.0.3
R2
R2(config)#router eigrp 100 AS编号和R1的一致才能建立邻居
R2(config-router)#network 192.168.10.0 0.0.0.255 宣告网段
R2(config-router)#network 10.10.10.0 0.0.0.255 宣告网段
R2(config-router)#passive-interface gigabitEthernet 0/0/1 被动接口,不向g0/0/1发送hello信息
R2(config-router)#no auto-summary 关闭自动汇总
验证
R1#show ip eigrp neighbors查看eigrp邻居表
R1#show ip route 查看路由表,D开头的表示EIGRP学习到的路由(因为使用DUAL算法,所以使用D来表示EIGRP)
EIGRP的AD值为90,5376表示度量值
R1#show ip eigrp topology 查看拓扑表,FD为5376,通告距离(AD)为5120
R1 ping PC0
EIGRP认证
R1配置认证
R1(config)#key chain EIGRP 创建一个名叫EIGRP的钥匙串
R1(config-keychain)#key 1 创建一个钥匙1
R1(config-keychain-key)#key-string cisco 创建一个钥匙字符串cisco(密码cisco)
R1(config)#interface g0/0/0 进入g0/0/0
R1(config-if)#ip authentication key-chain eigrp 100 EIGRP 启用EIGRP认证
R1(config-if)#ip authentication mode eigrp 100 md5 认证模式为MD5
由于R2没有做认证,所以邻居down掉,down掉的方式是认证失败
R2配置认证
R2(config)#key chain CISCO 创建一个名叫CISCO的钥匙串 (钥匙串名字可以不一致,但是密码必须一致)
R2(config-keychain)#key 1 创建一个钥匙1
R2(config-keychain-key)#key-string cisco 创建一个钥匙字符串cisco(密码cisco)和R1一致
R2(config)#interface g0/0/0 进入g0/0/0
R2(config-if)#ip authentication key-chain eigrp 100 CISCO 启用EIGRP认证
R2(config-if)#ip authentication mode eigrp 100 md5 认证模式为MD5
验证
又重新建立了邻居关系