浮動靜態(tài)路由之SLA(靜態(tài)路由中的浮動路由)
本篇SLA配置是付費閱讀,如您比較介意,請繞行,謝謝!
IP SLA介紹
SLA (Service-Level Agreement)服務級別協(xié)議,簡單的理解,就是測量一些網(wǎng)絡性能參數(shù),在超過一些門限值時,結(jié)合track或者EEM它可以觸發(fā)一些操作。例如:
1. 監(jiān)控下一跳的可達性,如果不可達了, 則讓某一靜態(tài)路由失效
2. 監(jiān)控鄰居的接口地址,如果連續(xù)三次不可達, 則將端口shutdown
企業(yè)生產(chǎn)環(huán)境當中,網(wǎng)絡比較復雜,中間連接的網(wǎng)絡設備較多,利用SLA的監(jiān)控目的是否可達來判斷該鏈路是否可達,以此來更靈活的偵測到主鏈路是否正常,異常時切換到備用鏈路。
實驗拓撲圖
R2-SW1-R1-SW2-R3 為主鏈路
R2-SW3-R3 為備鏈路
SW交換機不配置數(shù)據(jù),當二層交換機使用
基礎數(shù)據(jù)配置
R1配置
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface ethernet 1/0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#interface ethernet 1/1
R1(config-if)#ip address 13.1.1.1 255.255.255.0
R1(config-if)#no shu
R2配置
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface ethernet 1/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#interface ethernet 1/1
R2(config-if)#ip address 23.1.1.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#interface ethernet
R2(config)#interface ethernet 1/2
R2(config-if)#ip address 1.1.1.2 255.255.255.0
R2(config-if)#
R3配置
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho
Router(config)#hostname R3
R3(config)#interface ethernet 1/0
R3(config-if)#ip address 13.1.1.3 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#interface ethernet 1/1
R3(config-if)#ip add 23.1.1.3 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#interface ethernet 1/2
R3(config-if)#ip address 2.2.2.3 255.255.255.0
R3(config-if)#no shu
PC1配置
VPCS> set pcname PC1
PC1>
PC1> ip 1.1.1.1/24 1.1.1.2
Checking for duplicate address...
PC1 : 1.1.1.1 255.255.255.0 gateway 1.1.1.2
PC1>
PC2配置
VPCS> set pcname PC2
PC2> ip 2.2.2.2/24 2.2.2.3
Checking for duplicate address...
PC1 : 2.2.2.2 255.255.255.0 gateway 2.2.2.3
PC2>
配置之后,請互相ping測試是否直連的都互通,確保沒有問題之后,開始配置靜態(tài)路由。
R1靜態(tài)路由配置
R1路由配置
R1(config)#ip route 1.1.1.0 255.255.255.0 ethernet 1/0 12.1.1.2
R1(config)#ip route 2.2.2.0 255.255.255.0 ethernet 1/1 13.1.1.3
SLA配置
R2和R3都需要配置SLA,不然一邊可以偵測到網(wǎng)絡不可達,而另一邊卻還認為網(wǎng)絡可達,造成路由丟包。