网络高可用性在企业网中的应用

文章参考:http://sf418.blog.51cto.com/5627295/985943

 

构建网络高可用性有很多方法,如:

1.服务器群集 包括LB:负载均衡群集 HA:高可用性群集

2.路由设备 HSRP :热备份路由协议  VRRP:虚拟路由器冗余协议

3.Linux 网络接口绑定bond

4.局域网lan 内: stp  rstp  mstp

5、广域网链路:浮动的静态路由  standby interface  链路捆绑

我们这次主要说一下广域网链路中的方法:

下面我们举案例来详细说明其中的配置:

某公司总部和分部在不同地方,其中要实现总部机器pc1和分部机器pc2安全和高可用的通信,这样其中走的是电信提供商网络和isdn拨号网络,但其中拨号网络带宽较低,所以正常情况下都是走电信,(也就是下图中的s0端口),当这条主链路出现故障时,自动转到拨号网络继续正常通信,具体配置如下:

1、方案 :静态路由浮动:

R0:配置:

[R0]int s0

[R0-Serial0]ip add 192.168.2.1 24    给s0端口配置ip

[R0-Serial0]int s1                 进入广域网链路接口

[R0-Serial1]ip add 192.168.3.1 24    给s1端口配置ip

[R0-Serial1]int eth 0

[R0-Ethernet0]ip add 192.168.1.1 24   给eth0端口配置ip

[R0-Ethernet0]quit

[R0]ospf enable                  启动ospf协议

[R0-ospf]int eth 0

[R0-Ethernet0]ospf en area 0        把eth0端口加入到ospf协议的区域0中

[R0-Ethernet0]int s0

[R0-Serial0]ospf en area 0          也把s0端口加入到区域0

[R0-Serial0]quit

[R0]ip route 192.168.4.0 24 192.168.3.2     再配置一条静态路由,走的是另一条链路

R1

[Router]sysname R1

[R1]int s0

[R1-Serial0]ip add 192.168.2.2 24

[R1-Serial0]int s1

[R1-Serial1]ip add 192.168.3.2 24

[R1-Serial1]int eth 0

[R1-Ethernet0]ip add 192.168.4.1 24

[R1-Ethernet0]quit

[R1]ospf en

[R1-ospf]int eth 0

[R1-Ethernet0]ospf en area 0

[R1-Ethernet0]int s0

[R1-Serial0]ospf en area 0

[R1-Serial0]quit

[R1]ip route 192.168.1.0 24 192.168.3.1

查看通信结果和通信走的路径:

由于ospf的优先级为10 ,静态路由的优先级为60,所以这里只看到ospf的路由表

当其中一个主路径断开时:

查看通信情况和走的路径:

可以看到走的是静态路由那条链路

当主路径再次连接好时:

再次回到主链路来进行通信:

2、方案standby interface:

R 1的配置:

R1]int s0

[R1-Serial0]ip add 192.168.2.2 24  给端口配置ip地址

[R1-Serial0]int s1

[R1-Serial1]ip add 192.168.3.2 24

[R1-Serial1]int eth 0

[R1-Ethernet0]ip add 192.168.4.1 24

[R1-Ethernet0]quit

[R1]ip route 192.168.1.0 24 192.168.3.1    配置主链路上的静态路由,

[R1]ip route 192.168.1.0 24 192.168.2.1    配置辅助链路上的静态路由

[R1]int s0                             进入s0 端口,说名这个是骨干链路

[R1-Serial0]standby int s1                配置备份接口

[R1-Serial0]standby timer enable-delay 10   骨干链路断开,进入备份链路的延迟是10秒

[R1-Serial0]standby timer disable-delay 10  如果干路恢复,10s后从备份链路切换到干路

[R1-Serial0]quit

[R1]dis cu                          查看配置的信息

 Now create configuration...

 Current configuration

 !

   version 1.74

   sysname R1

   firewall enable

   aaa-enable

   aaa accounting-scheme optional

 !

 interface Aux0

   async mode flow

   link-protocol ppp

 !

 interface Ethernet0

   ip address 192.168.4.1 255.255.255.0

 !

 interface Ethernet1

 !

 interface Serial0

   link-protocol ppp

   standby interface Serial 1

   standby timer enable-delay 10

   standby timer disable-delay 10

ip address 192.168.2.2 255.255.255.0 

 !

 interface Serial1

   clock DTECLK1

   link-protocol ppp

   ip address 192.168.3.2 255.255.255.0

 !

 interface Async0

   physical-mode async

   async mode protocol

   link-protocol ppp

 !

 interface Async1

   physical-mode async

   async mode protocol

   link-protocol ppp

 quit

 ip route-static 192.168.1.0 255.255.255.0 192.168.3.1 preference 60

 ip route-static 192.168.1.0 255.255.255.0 192.168.2.1 preference 60

 !

 return

R 0的配置:

[R0]int s0

[R0-Serial0]ip add 192.168.2.1 24    给s0端口配置ip

[R0-Serial0]int s1                 进入广域网链路接口

[R0-Serial1]ip add 192.168.3.1 24    给s1端口配置ip

[R0-Serial1]int eth 0

[R0-Ethernet0]ip add 192.168.1.1 24   给eth0端口配置ip

[R0-Ethernet0]quit

[R0]ip route 192.168.4.0 24 192.168.3.2   配置3.0网段的静态路由

[R0]ip route 192.168.4.0 24 192.168.2.2   配置2.0网段的静态路由

[R0]int s0                             进入骨干链路接口

[R0-Serial0]standby int s1               配置备份链路

[R0-Serial0]standby time enable 10      骨干链路断开,进入备份链路的延迟是10秒

[R0-Serial0]standby time disable 10    骨干链路恢复正常时,进入干路延迟是10秒

[R0-Serial0]dis cu

 Now create configuration...

 Current configuration

 !

   version 1.74

   local-user user1 service-type administrator password simple 123

   sysname R0

   firewall enable

   aaa-enable

   aaa accounting-scheme optional

 !

 interface Aux0

   async mode flow

   link-protocol ppp

 !

 interface Ethernet0

   ip address 192.168.1.1 255.255.255.0

 !

 interface Ethernet1

 !

 interface Serial0

   clock DTECLK1

   link-protocol ppp

   standby interface Serial 1

   standby timer enable-delay 10        

   standby timer disable-delay 10

   ip address 192.168.2.1 255.255.255.0

 !

 interface Serial1

   link-protocol ppp

   ip address 192.168.3.1 255.255.255.0

 !

 quit

 ip route-static 192.168.4.0 255.255.255.0 192.168.3.2 preference 60

 ip route-static 192.168.4.0 255.255.255.0 192.168.2.2 preference 60

 !

 Return

配置完毕,查看其通信情况

追踪路径信息:

当把R1上s0断开时,看其状态:

再把R1上s0断开打开:

再看其追踪的路径:

又改成走主路径了:

3、方案:链路捆绑:

现在为了增加两台机器之间的带宽,我们可以用端口绑定的方法来实现:

具体配置如下:

配置R1:

[R1]int eth 0

[R1-Ethernet0]ip add 192.168.4.1 24   给eth0端口配置ip

[R1-Ethernet0]quit

[R1]int virtual 10                   创建虚拟接口模版10;

[R1-Virtual-Template10]ip add 192.168.6.2 24  为虚拟接口配置ip 地址

[R1-Virtual-Template10]quit

[R1]int s0                  进入s0端口

R1-Serial0]ppp mp  int virtual 10   将该接口绑定到虚拟接口上

[R1-Serial0]int s1           进入S1端口

[R1-Serial1]ppp mp int virtual 10    将该接口绑定到虚拟接口上

[R1-Serial1]ppp mp    开启该端口绑定功能

[R1-Serial1]int s0

[R1-Serial0]ppp mp  开启多路绑定

[R1-Serial0]quit

[R1]ospf enable      打开ospf协议

[R1]int vir 10        进入虚拟端口

[R1-Virtual-Template10]ospf enable area 0    把该虚拟端口加入到ospf的0区域

R0的配置:

[R0]int eth 0

[R0-Ethernet0]ip add 192.168.1.1 24   给eth0端口配置ip

[R0-Ethernet0]quit

[R0]int virtual 10                  进入虚拟端口

[R0-Virtual-Template10]ip add 192.168.6.1 24    配置虚拟地址

[R0-Virtual-Template10]quit

[R0]int s0

[R0-Serial0]ppp mp     开启该端口的多路绑定

[R0-Serial0]ppp mp int virtual 10   把该端口绑定到虚拟链路中

[R0-Serial0]int s1

[R0-Serial1]ppp mp       开启s1端口的多链路绑定

[R0-Serial1]ppp mp int virtual 10    绑定到虚拟链路中

[R0-Serial1]quit

[R0]ospf enable                打开ospf协议

 Start OSPF task...

 OSPF enabled

[R0-ospf]int virtual 10  

[R0-Virtual-Template10]ospf enable area 0   把虚拟接口加入到区域0

[R0-Virtual-Template10]quit

[R0]dis cu

 Now create configuration...

 Current configuration

 !

   version 1.74

   local-user user1 service-type administrator password simple 123

   sysname R0

   firewall enable

   aaa-enable

   aaa accounting-scheme optional

 !

 interface Aux0

   async mode flow

   link-protocol ppp

 !

 interface Ethernet0

   ip address 192.168.1.1 255.255.255.0

 !

 interface Ethernet1

 !

 interface Serial0

   clock DTECLK1

   link-protocol ppp

   ppp mp

   ppp mp interface Virtual-Template10  

 !

 interface Serial1

   link-protocol ppp

   ppp mp

   ppp mp interface Virtual-Template10

 !

 interface Virtual-Template10

   link-protocol ppp

   ip address 192.168.6.1 255.255.255.0

   ospf enable area 0.0.0.0

 !

 quit

 ospf enable

 !

 quit

 !

 Return

查看其通信结果:

 

你可能感兴趣的:(企业网,网络高可用性)