天天看点

高可用性链路(基于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,如需转载请自行联系原作者

继续阅读