028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

PIX--failover-创新互联

Failover

上海ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18982081108(备注:SSL证书合作)期待与您的合作!

概述

Failover与我们前面学习的HSRP很像,都可以说是提供故障恢复的功能。

1.Active与Standby

如何成为Active?

当一台防火墙启动的时候,就开始了一个选举的进程(以下都是基于两台设备为健康状态)

注:Primary、Secondary与Active、Standby的区分?

2.如何切换

正常切换

Active设备出现故障时,处于Standby的设备(如果是健康的)将成为Active转发数据。

切换发生时

3.管理

4.部署Failover设备的必要条件

硬件需求

软件需求

授权需求

5.部署方式

注:是针对FO接口来说的

无状态化FO

状态化FO

6.接口类型

7.健康监控

单元(即设备)健康监控

接口健康监控

8.部署方针

部署FO接口时,考虑如下的部署方针

注:如果FO接口坏掉,那么Failover将不能实现故障恢复的功能,FO相当于整个Failover的心脏,具有不可替代的作用。

配置实例

一.实验目的

二.实验拓扑

PIX--failover

如上:通过规划、配置,用两台PIX实现故障恢复功能。保证一台设备出问题之后另一台设备能继续工作。其中R1为Inside设备,R2为Outside设备

三.实验步骤

1.区域设备基本配置

-----------------------------------------R1配置-----------------------------------

R1(config)#inter fa0/0

R1(config-if)#ip add 192.168.1.1  255.255.255.0

R1(config-if)#no shut

R1(config-if)#full-duplex

R1(config-if)#exit

R1(config)#ip route 0.0.0.0 0.0.0.0  192.168.1.253

<指默认路由到PIX>

-----------------------------------------R2配置-----------------------------------

R2(config)#inter fa0/0

R2(config-if)#ip add 202.100.1.1  255.255.255.0

R2(config-if)#no shut

R2(config-if)#fu

R2(config-if)#full-duplex

R2(config-if)#exit

2.Primary设备配置

--------------------------------------------接口初始化配置----------------------------------

PIX1(config)# inter e0

PIX1(config-if)# nameif inside

PIX1(config-if)# ip add 192.168.1.253  255.255.255.0 standby 192.168.1.254

<配置主地址和Standby地址>

PIX1(config-if)# no shut

PIX1(config-if)# exit

<内部接口配置,默认级别为100>

PIX1(config)# inter e1

PIX1(config-if)# nameif outside

PIX1(config-if)# ip add 202.100.1.253  255.255.255.0 standby 202.100.1.254

PIX1(config-if)# no shut

PIX1(config-if)# exit

<外部接口配置,默认级别为0>

-----------------------------------------------配置FO---------------------

PIX1(config)# inter e2

PIX1(config-if)# no shut

PIX1(config-if)# exit

<启用接口>

PIX1(config)# failover lan unit primary

<把本设备指定为Primary设备>

PIX1(config)# failover lan interface FO  e2

<指定接口E2为FO链路,接口名为FO,此配置要敲2遍才能生效>

INFO: Non-failover interface config is  cleared on Ethernet2 and its sub-interfaces

PIX1(config)# failover lan interface FO  e2

PIX1(config)# failover key cisco

<设置FO之间传输的加密密钥>

PIX1(config)# failover interface ip FO  172.16.1.1 255.255.255.0 standby 172.16.1.2

<设置FO链路两端的IP地址>

PIX1(config)# failover

<启用Failover>

Secondary配置

PIX2(config)# inter e2

PIX2(config-if)# no shut

PIX2(config-if)# exit

PIX2(config)# failover lan unit secondary

PIX2(config)# failover lan interface FO  e2

INFO: Non-failover interface config is  cleared on Ethernet2 and its sub-interfaces

PIX2(config)# failover lan interface FO  e2

PIX2(config)# failover key cisco

PIX2(config)# failover interface ip FO  172.16.1.1 255.255.255.0 standby 172.16.2

PIX2(config)# failover

配置完成后,两台设备开始协商选择Active,并同步配置

State check detected an Active mate

Beginning configuration replication from  mate.

End configuration replication from mate.

<点击回车完成>

此时,无状态的failover已经完成。PIX2同步PIX1的配置后,自己主机名也成为PIX1,并复制所有PIX1的配置到自己。

查看PIX状态

---------------------------------------查看PIX1状态--------------------

PIX1(config)# show failover

Failover  On

Cable status: N/A - LAN-based failover  enabled

Failover  unit Primary

Failover LAN Interface: FO Ethernet2 (up)

Unit Poll frequency 15 seconds, holdtime  45 seconds

Interface Poll frequency 5 seconds,  holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 2 of 250 maximum

Version: Ours 7.2(2), Mate 7.2(2)

Last Failover at: 06:42:20 UTC Apr 8 2015

        This host: Primary - Active

               Active time: 405 (sec)

                  Interface inside (192.168.1.253): Normal

                 Interface outside  (202.100.1.253): Unknown (Waiting)

        Other  host: Secondary - Standby Ready

               Active time: 120 (sec)

                 Interface inside (192.168.1.254): Normal

                 Interface outside  (202.100.1.254): Unknown (Waiting)

Stateful Failover Logical Update  Statistics

        Link : Unconfigured.

-------------------------------------------------查看PIX2状态---------------------------

PIX1(config)# show failover

Failover  On

Cable status: N/A - LAN-based failover  enabled

Failover  unit Secondary

Failover LAN Interface: FO Ethernet2 (up)

Unit Poll frequency 15 seconds, holdtime  45 seconds

Interface Poll frequency 5 seconds,  holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 2 of 250 maximum

Version: Ours 7.2(2), Mate 7.2(2)

Last Failover at: 06:44:35 UTC Apr 8 2015

        This host: Secondary - Standby Ready

               Active time: 120 (sec)

                  Interface inside (192.168.1.254): Normal

                 Interface outside  (202.100.1.254): Unknown (Waiting)

        Other  host: Primary - Active

               Active time: 480 (sec)

                 Interface  inside (192.168.1.253): Normal

                 Interface outside  (202.100.1.253): Unknown (Waiting)

Stateful Failover Logical Update  Statistics

        Link : Unconfigured.

<虽然PIX2的主机名变为了PIX1,但是根据状态我们还是能区分出来的>

验证无状态化连接

用R1telnet连接R2

R2(config)#lin vty 0 4

R2(config-line)#password gyh

R2(config-line)#login

R2(config-line)#exit

R1#telnet 202.100.1.1

Trying 202.100.1.1 ... Open

User Access Verification

Password:

R2>

<连接成功>

--------------------------------------------将R3-SW的fa1/1接口down------------------------------

R3-SW(config)#inter fa1/1

R3-SW(config-if)#shut

R3-SW(config-if)#

*Mar  1 01:20:49.651: %LINK-5-CHANGED: Interface FastEthernet1/1, changed  state to administratively down

*Mar  1 01:20:50.651: %LINEPROTO-5-UPDOWN: Line protocol on Interface  FastEthernet1/1, changed state to down

--------------------------------------------查看R1的telnet连接状况--------------------------------

R2>

[Connection to 202.100.1.1 closed by  foreign host]

<连接直接中断>

----------------------------------------------查看PIX状态------------------------

PIX1(config)#

        Switching to Standby

PIX1(config)#

        Switching to Active

PIX1(config)# show failover

Failover  On

Cable status: N/A - LAN-based failover  enabled

Failover  unit Primary

Failover LAN Interface: FO Ethernet2 (up)

Unit Poll frequency 15 seconds, holdtime  45 seconds

Interface Poll frequency 5 seconds,  holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 2 of 250 maximum

Version: Ours 7.2(2), Mate 7.2(2)

Last Failover at: 08:05:36 UTC Apr 8 2015

        This  host: Primary - Failed

               Active time: 2595 (sec)

                 Interface inside (192.168.1.254): Failed  (Waiting)

                 Interface outside  (202.100.1.254): Normal

        Other host: Secondary - Active

               Active time: 2340 (sec)

                 Interface inside (192.168.1.253): Normal  (Waiting)

                 Interface outside  (202.100.1.253): Normal

 

Stateful Failover Logical Update  Statistics

        Link : Unconfigured.

PIX1(config)# show failover

Failover  On

Cable status: N/A - LAN-based failover  enabled

Failover  unit Secondary

Failover LAN Interface: FO Ethernet2 (up)

Unit Poll frequency 15 seconds, holdtime  45 seconds

Interface Poll frequency 5 seconds,  holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 2 of 250 maximum

Version: Ours 7.2(2), Mate 7.2(2)

Last Failover at: 08:07:57 UTC Apr 8 2015

        This host: Secondary - Active

               Active time: 2355 (sec)

                  Interface inside (192.168.1.253): Normal  (Waiting)

                 Interface outside  (202.100.1.253): Normal

       Other host: Primary - Failed

               Active time: 2595 (sec)

                  Interface inside (192.168.1.254):  Failed (Waiting)

                 Interface outside  (202.100.1.254): Normal

Stateful Failover Logical Update  Statistics

        Link : Unconfigured.

本实验在无状态化实验的基础上进行。

恢复正常的网络,开启R3-SW的fa1/1接口

R3-SW(config-if)#inter fa1/1

R3-SW(config-if)#no shut

*Mar  1 01:25:17.023: %LINEPROTO-5-UPDOWN: Line protocol on Interface  FastEthernet1/1, changed state to up

手动让PIX1恢复为active状态

PIX1(config)# failover active

        Switching to Active

PIX1(config)# show failover

Failover  On

Cable status: N/A - LAN-based failover  enabled

Failover  unit Primary

Failover LAN Interface: FO Ethernet2 (up)

Unit Poll frequency 15 seconds, holdtime  45 seconds

Interface Poll frequency 5 seconds,  holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 2 of 250 maximum

Version: Ours 7.2(2), Mate 7.2(2)

Last Failover at: 08:09:10 UTC Apr 8 2015

        This  host: Primary - Active

               Active time: 2595 (sec)

                 Interface inside  (192.168.1.253): Normal (Waiting)

                 Interface outside  (202.100.1.253): Normal (Waiting)

       Other host: Secondary - Standby Ready  

               Active time: 2475 (sec)

                  Interface inside (192.168.1.254):  Normal (Waiting)

                 Interface outside  (202.100.1.254): Normal (Waiting)

 

Stateful Failover Logical Update  Statistics

        Link : Unconfigured.

设置LAN-FO(状态化)接口

第一种情况:

把LAN-FO接口设置成stateful接口

PIX1(config)# failover  link FO e2

R1 telnet上R2

R1#telnet 202.100.1.1

Trying 202.100.1.1 ... Open

User Access Verification

Password:

R2>

关闭R3-SW的fa1/1接口

R3-SW(config-if)#inter fa1/1

R3-SW(config-if)#shut

*Mar  1 01:33:16.495: %LINK-5-CHANGED: Interface FastEthernet1/1, changed  state to administratively down

*Mar  1 01:33:17.495: %LINEPROTO-5-UPDOWN: Line protocol on Interface  FastEthernet1/1, changed state to down

查看设备的Failover状态

PIX1(config)# show failover

Failover  On

Cable status: N/A - LAN-based failover  enabled

Failover  unit Primary

Failover LAN Interface: FO Ethernet2 (up)

Unit Poll frequency 15 seconds, holdtime  45 seconds

Interface Poll frequency 5 seconds,  holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 2 of 250 maximum

Version: Ours 7.2(2), Mate 7.2(2)

Last Failover at: 08:46:42 UTC Apr 8 2015

        This  host: Primary - Failed

               Active time: 75 (sec)

                 Interface inside (192.168.1.254): Failed  (Waiting)

                 Interface outside  (202.100.1.254): Normal

        Other host: Secondary - Active

               Active time: 180 (sec)

                 Interface inside (192.168.1.253): Normal  (Waiting)

                 Interface outside  (202.100.1.253): Normal

Stateful Failover Logical Update  Statistics

        Link : FO Ethernet2 (up)

        Stateful Obj   xmit      xerr      rcv       rerr

        General        37        0         36        0

        sys cmd        33        0         33        0

       up time        0         0         0         0

        RPC services   0         0         0         0

        TCP conn       2         0         3         0

        UDP conn       0         0         0         0

        ARP tbl        2         0         0         0

        Xlate_Timeout  0         0         0         0

        ××× IKE upd    0         0         0         0

        ××× IPSEC upd  0         0          0         0

        ××× CTCP upd   0         0         0         0

        ××× SDI upd    0         0         0         0

        ××× DHCP upd   0         0         0         0

        Logical Update Queue Information

                       Cur    Max     Total

        Recv Q:        0      1       229

        Xmit Q:        0      2       94

在R1上回车,看连接R2的状态是否中断

R2>

R2>

R2>

R2>

R2>

<连接正常>

注:把stateful与FO接口设置成一条链路是我们不推荐的,所以,尽管这种方法可行,一般不使用。

第二种情况:

另接一条线,设置成stateful接口(FO链路与stateful链路分开)

PIX1(config)# inter e3

PIX1(config-if)# no shut

PIX1(config)# failover link stateful e3

<注:使用此命令时,会报ERROR: No change to the stateful interface的错误,但是命令依然可以起到作用,可以show run查看。这是模拟器的问题。请继续试验。>

PIX1(config)# failover interface ip  stateful 172.16.10.10 255.255.255.0 standby 172.16.10.11

验证

R1 telnet上R2

R1#telnet 202.100.1.1

Trying 202.100.1.1 ... Open

User Access Verification

Password:

R2>

关闭R3-SW的fa1/1接口

R3-SW(config-if)#inter fa1/1

R3-SW(config-if)#shut

*Mar  1 01:33:16.495: %LINK-5-CHANGED: Interface FastEthernet1/1, changed  state to administratively down

*Mar  1 01:33:17.495: %LINEPROTO-5-UPDOWN: Line protocol on Interface  FastEthernet1/1, changed state to down

查看设备的Failover状态

PIX1(config)# show failover

Failover  On

Cable status: N/A - LAN-based failover  enabled

Failover  unit Primary

Failover LAN Interface: FO Ethernet2 (up)

Unit Poll frequency 15 seconds, holdtime  45 seconds

Interface Poll frequency 5 seconds,  holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 2 of 250 maximum

Version: Ours 7.2(2), Mate 7.2(2)

Last Failover at: 08:46:42 UTC Apr 8 2015

        This  host: Primary - Failed

               Active time: 75 (sec)

                 Interface inside (192.168.1.254): Failed  (Waiting)

                 Interface outside  (202.100.1.254): Normal

        Other host: Secondary - Active

               Active time: 180 (sec)

                 Interface inside (192.168.1.253): Normal  (Waiting)

                 Interface outside  (202.100.1.253): Normal

Stateful Failover Logical Update  Statistics

        Link : FO Ethernet2 (up)

        Stateful Obj   xmit      xerr      rcv       rerr

        General        37        0         36        0

        sys cmd        33        0         33        0

        up time        0         0         0         0

        RPC services   0         0         0         0

        TCP conn       2         0         3          0

        UDP conn       0         0         0         0

        ARP tbl        2         0         0         0

        Xlate_Timeout  0         0         0         0

        ××× IKE upd    0         0         0         0

        ××× IPSEC upd  0         0         0         0

        ××× CTCP upd   0         0         0         0

        ××× SDI upd    0         0         0         0

        ××× DHCP upd   0         0         0         0

        Logical Update Queue Information

                       Cur    Max     Total

        Recv Q:        0      1       229

        Xmit Q:        0      2       94

在R1上回车,看连接R2的状态是否中断

R2>

R2>

R2>

R2>

R2>

<连接正常>

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


当前文章:PIX--failover-创新互联
网页链接:http://www.tsicrk.com/article/csoeps.html

其他资讯

让你的专属顾问为你服务

1.2202s