企業網數通方案實戰之EIGRP
實戰目標:
通過實戰應用,掌握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應用的實戰案例,希望能對大家有所幫助,共同探討學習。