实战目标:
通过实战应用,掌握EIGRP的工作原理和实际操作能力。
案例需求说明及业务部署规划:
公司建有两个办公点,分别为总部和分支;
决定全网使用EIGRP作为动态路由协议,自治系统号码为 666;
其中总部和分支的R1和R3两台设备通过运营商提供的二层×××互联,实现总部和分支的通信,使用单播建立EIGRP邻居并部署HMAC认证,密钥自定义;
R2和R5为末节路由器,通过一条低速链路互联作为二层×××的备份,使用单播建立EIGRP邻居并部署MD5认证,密钥自定义;
总部和分支之间的业务流量经过二层×××转发,但是当二层×××故障时,备份链路则必须承担起全部转发责任,通过路由汇总实现主备链路的数据转发控制;
其中Server1和Server2之间每天有少量特殊业务流量需要通过低速备份链路互通,在两台Server所在子网设置辅助地址,专门为特殊业务流量服务;
R3和R4为整个企业的互联网网关,负责企业所有的接入互联网流量,其中以R3为高速链路,R4为低速链路;部署端口NAT,以为企业内部提供互联网服务;
在避免链路资源浪费的同时保障链路转发负载合理,R3和R4在将去往互联网的默认路由引入EIGRP时设置不同的度量值,在R5上实现去往互联网的业务流量非等价负载均衡;
考虑到业务可扩展性等因素,全网设备部署命名的EIGRP配置方式;定义命名的EIGRP实例名称为 QYT;
为保证协议稳定运行,为每台设备配置router-id 例:R1 router-id 为 10.0.0.1、R2 router-id 为 10.0.0.2;
本案例在模拟器上的练习拓扑,可按照如下结构搭建:
下面为大家展示案例配置方案:
一、配置IP地址 (展示省略)
设备接口地址为 网络地址.Y,其中Y为设备编号,例如R1的E0/3接口IP地址为:10.12.13.1/24
PC和Server由路由器的环回口模拟
- R2#show run interface loopback 0
- interface Loopback0
- ip address 10.2.201.100 255.255.255.0 secondary
- ip address 10.2.100.100 255.255.255.0 secondary
- ip address 10.2.200.100 255.255.255.0
- R5#show run interface loopback 0
- interface Loopback0
- ip address 10.1.201.100 255.255.255.0 secondary
- ip address 10.1.100.100 255.255.255.0 secondary
- ip address 10.1.200.100 255.255.255.0
IP地址配置完毕,一定要测试直连是否OK。
二、全网部署EIGRP
- R1#show run | s r e
- router eigrp QYT
- !
- address-family ipv4 unicast autonomous-system 666
- !
- topology base
- exit-af-topology
- network 10.0.0.0
- eigrp router-id 10.0.0.1 //这一部分每台设备除此处不一样之外,其它配置都一样//
- exit-address-family
配置完毕,请检查EIGRP邻居状态及路由条目,确保配置无误;
检查命令:
- show ip eigrp neighbors
- show ip route eigrp | begin Gateway
三、总部和分支互联设备上配置单播邻居及认证
R1:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- neighbor 10.12.13.3 Ethernet0/3
- af-interface e0/3
- authentication mode hmac-sha-256 CCNP
R3:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- neighbor 10.12.13.1 Ethernet0/3
- af-interface e0/3
- authentication mode hmac-sha-256 CCNP
R2:
- key chain CISCO
- key 1
- key-string CCNP
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- neighbor 10.12.25.5 Serial1/1
- af-interface Serial1/1
- authentication mode md5
- authentication key-chain CISCO
R5:
- key chain CISCO
- key 1
- key-string CCNP
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- neighbor 10.12.25.2 Serial1/1
- af-interface Serial1/1
- authentication mode md5
- authentication key-chain CISCO
四、部署末节路由器
R2和R5:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- eigrp stub
五、实现二层×××和低速备份链路之间的主备
在R2和R5上针对本区域的路由进行汇总,实现通过最长匹配原则进行主备链路的流量转发控制;
R2:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- af-interface Serial1/1
- summary-address 10.2.0.0 255.255.0.0
R5:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- af-interface Serial1/1
- summary-address 10.1.0.0 255.255.0.0
验证:
- R2#traceroute 10.1.100.100 source 10.2.100.100 numeric
- Type escape sequence to abort.
- Tracing the route to 10.1.100.100
- VRF info: (vrf in name/id, vrf out name/id)
- 1 10.2.12.1 9 msec 9 msec 9 msec
- 2 10.12.13.3 9 msec 9 msec 10 msec
- 3 10.1.35.5 9 msec * 6 msec
- R5#traceroute 10.2.100.100 source 10.1.100.100 numeric
- Type escape sequence to abort.
- Tracing the route to 10.2.100.100
- VRF info: (vrf in name/id, vrf out name/id)
- 1 10.1.35.3 1 msec 0 msec 1 msec
- 2 10.12.13.1 1 msec 0 msec 1 msec
- 3 10.2.12.2 9 msec * 10 msec
断开R1和R3之间的链路,验证备份链路是否能够正常转发流量;
- R1#configure terminal
- R1(config)#interface e0/3
- R1(config-if)#shutdown
- R2#traceroute 10.1.100.100 source 10.2.100.100 numeric
- Type escape sequence to abort.
- Tracing the route to 10.1.100.100
- VRF info: (vrf in name/id, vrf out name/id)
- 1 10.12.25.5 9 msec * 9 msec
- R5#traceroute 10.2.100.100 source 10.1.100.100 numeric
- Type escape sequence to abort.
- Tracing the route to 10.2.100.100
- VRF info: (vrf in name/id, vrf out name/id)
- 1 10.12.25.2 8 msec * 9 msec
测试完毕,请不要忘记恢复链路。
六、实现特殊业务走低速链路的需求
leak-map在EIGRP中并不止一种应用方案哦,下面介绍结合汇总命令的用法;
上面开启了末节路由器特性,默认仅仅通告本地产生的直连路由和汇总路由出去;
然后又做了汇总,汇总则抑制掉了明细;
现在,通过leak-map在汇总之后,允许特定的直连路由被通告给汇总方向的邻居;
配置:
R2:
- access-list 2 permit 10.2.201.0 0.0.0.255
- route-map LEAK permit 10
- match ip address 2
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- af-interface Serial1/1
- summary-address 10.2.0.0 255.255.0.0 leak-map LEAK
R5:
- access-list 2 permit 10.1.201.0 0.0.0.255
- route-map LEAK permit 10
- match ip address 1
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- af-interface Serial1/1
- summary-address 10.2.0.0 255.255.0.0 leak-map LEAK
验证:
- R2#show ip eigrp topology 10.1.201.0/24 | include from
- 10.12.25.5 (Serial1/1), from 10.12.25.5, Send flag is 0x0
- 10.2.12.1 (Serial1/0), from 10.2.12.1, Send flag is 0x0
- R5#show ip eigrp topology 10.2.201.0/24 | include from
- 10.12.25.2 (Serial1/1), from 10.12.25.2, Send flag is 0x0
测试:
- R2#traceroute 10.1.201.100 source 10.2.201.100 numeric
- Type escape sequence to abort.
- Tracing the route to 10.1.201.100
- VRF info: (vrf in name/id, vrf out name/id)
- 1 10.12.25.5 9 msec * 9 msec
- R5#traceroute 10.2.201.100 source 10.1.201.100 numeric
- Type escape sequence to abort.
- Tracing the route to 10.2.201.100
- VRF info: (vrf in name/id, vrf out name/id)
- 1 10.12.25.2 9 msec * 9 msec
七、配置NAT
此部分不作为本案例研究重点,配置部分仅作示例
- R3(config)#int e0/2
- R3(config-if)#ip nat outside
- R3(config)#int e0/3
- R3(config-if)#ip nat inside
- access-list 1 permit 10.0.0.0 0.0.0.255
- ip nat inside source list 1 interface 【XXX】 overload
八、合理分配R3和R4的上行链路资源
在R3和R4上配置静态默认路由,并以不同度量值引入EIGRP,尽量体现网络上行链路实际情况
- R3(config)#ip route 0.0.0.0 0.0.0.0 36.1.1.6
- R4(config)#ip route 0.0.0.0 0.0.0.0 s1/0
R3:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- topology base
- redistribute static metric 10000 100 255 1 1500
R4:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- topology base
- redistribute static metric 1544 2000 255 1 1500
九、在R5上实现去往互联网的业务流量非等价负载均衡
查看拓扑表,仅有一个后继,没有发现可行后继,说明要么只收到一个路径,要么就是有其它路径,但并不符合可行条件;
- R5#show ip eigrp topology
- P 0.0.0.0/0, 1 successors, FD is 196608000
- via 10.1.35.3 (196608000/131072000), Ethernet0/1
查看拓扑表详细信息:
- R5#show ip eigrp topology detail-links
- P 0.0.0.0/0, 1 successors, FD is 196608000, serno 83
- via 10.1.35.3 (196608000/131072000), Ethernet0/1
- via 10.1.45.4 (1800711958/1735175958), Ethernet0/2
从R4方向收到的关于默认路由的通告度量值为 1735175958 ,远远大于当前的可行距离 196608000;
要做非等价负载均衡,可行后继是必不可少的,通过偏移列表为从R5收到的相关前缀增加度量值,使得R4方向收进来的默认前缀能够满足可行条件,从而使R4成为可行后继;
1735175958 - 196608000 = 1538567958 我们为从R3收到的前缀增加的度量值 稍微 1538567958 整个数字即可
R5:
- access-list 5 permit 0.0.0.0
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- topology base
- offset-list 5 in 1538570000 Ethernet0/1
验证:
- R5#show ip eigrp topology
- P 0.0.0.0/0, 1 successors, FD is 1735178000
- via 10.1.35.3 (1735178000/1669642000), Ethernet0/1
- via 10.1.45.4 (1800711958/1735175958), Ethernet0/2
现在,我们根据通告距离和当前可行距离计算非等价负载均衡变量:
可行后继路径上的可行距离 / 当前可行距离 并向上取整
- 1800711958 / 1735178000 = 2
R5:
- router eigrp QYT
- address-family ipv4 unicast autonomous-system 666
- topology base
- variance 2
验证:
- R5#show ip route eigrp | begin Gateway
- Gateway of last resort is 10.1.45.4 to network 0.0.0.0
- D*EX 0.0.0.0/0 [170/14068062] via 10.1.45.4, 00:00:54, Ethernet0/2
- [170/13556078] via 10.1.35.3, 00:00:54, Ethernet0/1
总结:这是一个专门考察EIGRP应用的实战案例,希望能对大家有所帮助,共同探讨学习。