高可用性概述:

随着网络的快速普及和应用的日益深入,各种增值业务在网络上得到了广泛部署,网络带宽也以指数级增长,网络短时间的中断就可能影响大量业务,造成重大损失。作为业务承载主体的基础网络,其高可用性(High Availablity,HA)也因此日益成为关注的焦点。那么,如何衡量一个网络的可用性呢?首先,一个高可用性网络不能频频出现故障,只要发生故障,即使是很短时间的中断,都会影响业务运营,特别在当前适时性强、对丢包和时延敏感的业务,。其次,高可用性的网络,即使出现故障,也应该能很快恢复。

案例一:使用浮动静态路由实现链路的高可用性(cisco模拟器)。

由于设备有限,在此使用两台路由器模拟主机,即PC-1及PC-2

拓扑方案:

p_w_picpath

配置:

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-if)#no shut
R1(config)#interface s0/1
R1(config-if)#ip add 192.168.3.1 255.255.255.0
R1(config-if)#no shut
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-if)#no shut
R2(config)#interface s0/1
R2(config-if)#ip add 192.168.3.2 255.255.255.0
R2(config-if)#no shut
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        #下面链路使用静态路由,作为备份

测试:

p_w_picpath

p_w_picpath

当断掉主链路后,查看是否能够启用备份链路:

p_w_picpath

案例二:使用浮动静态路由实现链路的高可用性(华为设备),左边的pc使用H3C防火墙代替。

拓扑方案:

p_w_picpath

配置:

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协议
  Start OSPF task...
  OSPF enabled
[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网络参数设置:

p_w_picpath

测试:

PC   ping防火墙:

p_w_picpath

p_w_picpath

p_w_picpath

当断掉R6的s0接口后,查看链路 通信状态及数据包走向

p_w_picpath

p_w_picpath

p_w_picpath

配置备份接口: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口后,查看网络盘通信过程图及数据走向

p_w_picpath

p_w_picpath

案例三:基于ppp协议的链路捆绑(华为设备),左边的pc使用H3C防火墙代替。

p_w_picpath

配置:

R6:

[R6]interface e0
[R6-Ethernet0]ip add 192.168.4.1 255.255.255.0
[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-Serial0]interface s1
[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:

[R14]interface e0
[R14-Ethernet0]ip add 192.168.1.1 255.255.255.0
[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-Serial0]interface s1
[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

测试:

p_w_picpath