天天看點

高可用性鍊路(基于wan)

高可用性概述:

随着網絡的快速普及和應用的日益深入,各種增值業務在網絡上得到了廣泛部署,網絡帶寬也以指數級增長,網絡短時間的中斷就可能影響大量業務,造成重大損失。作為業務承載主體的基礎網絡,其高可用性(High Availablity,HA)也是以日益成為關注的焦點。那麼,如何衡量一個網絡的可用性呢?首先,一個高可用性網絡不能頻頻出現故障,隻要發生故障,即使是很短時間的中斷,都會影響業務營運,特别在目前适時性強、對丢包和時延敏感的業務,。其次,高可用性的網絡,即使出現故障,也應該能很快恢複。

案例一:使用浮動靜态路由實作鍊路的高可用性(cisco模拟器)。

由于裝置有限,在此使用兩台路由器模拟主機,即PC-1及PC-2

拓撲方案:

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112526IIOL.png"></a>

配置:

PC-1:

PC-1(config)#interface ethernet 0/0 

PC-1(config-if)#ip add 192.168.1.1 255.255.255.0 

PC-1(config-if)#no shut 

PC-1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2    #靜态路由,指向網關

PC-2:

PC-2(config)#interface ethernet 0/0 

PC-2(config-if)#ip add 192.168.4.1 255.255.255.0 

PC-2(config-if)#no shut 

PC-2(config)#ip route 0.0.0.0 0.0.0.0 192.168.4.2   #靜态路由,指向網關

R1:

R1(config)#interface ethernet 1/0 

R1(config-if)#ip add 192.168.1.2 255.255.255.0 

R1(config-if)#no shut 

R1(config)#interface s0/0 

R1(config-if)#ip add 192.168.2.1 255.255.255.0 

R1(config)#interface s0/1 

R1(config-if)#ip add 192.168.3.1 255.255.255.0 

R1(config)#router ospf 100 

R1(config-router)#network 192.168.1.0 0.0.0.255 area 0     #通告ospf網絡 

R1(config-router)#network 192.168.2.0 0.0.0.255 area 0     #通告ospf網絡 

R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.2      #下面鍊路使用靜态路由,作為備份

R2:

R2(config)#interface e1/0 

R2(config-if)#ip add 192.168.4.2 255.255.255.0 

R2(config-if)#no shut 

R2(config)#interface s0/0 

R2(config-if)#ip add 192.168.2.2 255.255.255.0 

R2(config)#interface s0/1 

R2(config-if)#ip add 192.168.3.2 255.255.255.0 

R2(config)#router ospf 100 

R2(config-router)#network 192.168.2.0 0.0.0.255 area 0      #通告ospf網絡 

R2(config-router)#network 192.168.4.0 0.0.0.255 area 0      #通告ospf網絡 

R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1        #下面鍊路使用靜态路由,作為備份

測試:

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112529M2DU.png"></a>

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112534oPqu.png"></a>

當斷掉主鍊路後,檢視是否能夠啟用備份鍊路:

<a href="http://blog.51cto.com/attachment/201209/220205422.png" target="_blank"></a>

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112544vwb0.png"></a>

案例二:使用浮動靜态路由實作鍊路的高可用性(華為裝置),左邊的pc使用H3C防火牆代替。

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112547o6Qz.png"></a>

R14:

[R14]interface e0 

[R14-Ethernet0]ip add 192.168.1.1 255.255.255.0 

[R14-Ethernet0]interface s0 

[R14-Serial0]ip add 192.168.2.1 255.255.255.0 

[R14-Serial0]interface s1 

[R14-Serial1]ip add 192.168.3.1 255.255.255.0 

[R14-Serial1]qu 

[R14]ospf enable          #啟用ospf協定 

  Start OSPF task... 

  OSPF enabled 

[R14-ospf]interface s0 

[R14-Serial0]ospf enable area 0     #s0口啟用ospf協定 

[R14-Serial0]interface e0 

[R14-Ethernet0]ospf enable area 0   #e0口啟用ospf協定 

[R14]ip route-static 0.0.0.0 0.0.0.0 192.168.3.2      #靜态路由作為鍊路的備份

R6:

[R6]interface e0 

[R6-Ethernet0]ip add 192.168.4.1 255.255.255.0 

[R6-Ethernet0]interface s0 

[R6-Serial0]ip add 192.168.2.2 255.255.255.0 

[R6-Serial0]shut 

[R6-Serial0]undo shut 

[R6-Serial0]interface s1 

[R6-Serial1]ip add 192.168.3.2 255.255.255.0 

[R6-Serial1]shut 

[R6-Serial1]undo shut 

[R6]ospf enable        #啟用ospf協定 

[R6-ospf]interface s0 

[R6-Serial0]ospf enable area 0      #s0口啟用ospf協定 

[R6-Serial0]interface e0 

[R6-Ethernet0]ospf enable area 0       #e0口啟用ospf協定 

[R6]ip route-static 0.0.0.0 0.0.0.0 192.168.3.1       #靜态路由作為鍊路的備份

H3C防火牆:

[H3C]interface Ethernet0/1 

[H3C-Ethernet0/1]ip add 192.168.1.2 255.255.255.0 

[H3C]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1    #預設路由指向R14e0口 

[H3C]firewall zone untrust     

[H3C-zone-untrust]add interface Ethernet 0/1

右邊的PC網絡參數設定:

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112550EbF2.png"></a>

PC   ping防火牆:

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_13471125518SGQ.png"></a>

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_134711255301ct.png"></a>

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_13471125553DdG.png"></a>

當斷掉R6的s0接口後,檢視鍊路 通信狀态及資料包走向

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112557pQKE.png"></a>

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112559W63y.png"></a>

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112561J7XX.png"></a>

配置備份接口:standby  interface(備份鍊路處于down狀态,當主鍊路出現故障時,備份鍊路自動up):

在上例中的R14和R6路由器隻做如下修改即可,其他一樣:

[R14]interface s0 

[R14-Serial0]standby interface s1     #備份端口是s1 

[R14-Serial0]standby timer enable-delay 10        #啟用備份接口的延遲10秒 

[R14-Serial0]standby timer disable-delay 10       #主鍊路恢複後,啟用主鍊路接口的延遲10秒

[R6]interface s0 

[R6-Serial0]standby interface s1      #備份端口是s1 

[R6-Serial0]standby timer enable-delay 10        #啟用備份接口的延遲10秒 

[R6-Serial0]standby timer disable-delay 10       #主鍊路恢複後,啟用主鍊路接口的延遲 10秒

當斷掉R6的s0口後,檢視網絡盤通信過程圖及資料走向

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112564IaYK.png"></a>

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_13471125689JvR.png"></a>

案例三:基于ppp協定的鍊路捆綁(華為裝置),左邊的pc使用H3C防火牆代替。

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112569StxA.png"></a>

[R6]interface virtual-template 1      #定義虛拟模闆端口 

[R6-Virtual-Template1]ip add 192.168.10.2 255.255.255.0 

[R6-Virtual-Template1]ppp mp       #啟用ppp多鍊路 

[R6-Virtual-Template1]interface s0 

[R6-Serial0]ppp mp       #啟用ppp多鍊路 

[R6-Serial0]ppp mp interface virtual-template 1    #将實體端口s0加入虛拟模闆端口 

[R6-Serial1]ppp mp       #啟用ppp多鍊路 

[R6-Serial1]ppp mp interface virtual-template 1     #将實體端口s1加入虛拟模闆端口 

[R6]ip route-static 192.168.1.0 255.255.255.0 192.168.10.1 

[R14]interface virtual-template 1    #定義虛拟模闆端口 

[R14-Virtual-Template1]ip add 192.168.10.1 255.255.255.0 

[R14-Virtual-Template1]ppp mp     #啟用ppp多鍊路 

[R14-Virtual-Template1]interface s0 

[R14-Serial0]ppp mp      #啟用ppp多鍊路 

[R14-Serial0]ppp mp interface virtual-template 1    #将實體端口s0加入虛拟模闆端口 

[R14-Serial1]ppp mp      #啟用ppp多鍊路 

[R14-Serial1]ppp mp interface virtual-template 1     #将實體端口s1加入虛拟模闆端口 

[R14]ip route-static 192.168.4.0 255.255.255.0 192.168.10.2

<a href="http://5493845.blog.51cto.com/attachment/201209/8/5493845_1347112572pZIx.png"></a>

本文轉自 liuyatao666 51CTO部落格,原文連結:http://blog.51cto.com/5503845/985470,如需轉載請自行聯系原作者

繼續閱讀