PIX--failover

发布时间:2020-07-23 01:01:46 作者:gyh380531251
来源:网络 阅读:545

Failover

 

概述

 

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

 

1.ActiveStandby

 

如何成为Active

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

 

注:PrimarySecondaryActiveStandby的区分?

 

 

2.如何切换

 

正常切换

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

 

切换发生时

 

 

3.管理

 

 

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

 

硬件需求

 

软件需求

 

授权需求

 

5.部署方式

 

注:是针对FO接口来说的

 

无状态化FO

 

 

状态化FO

 

 

6.接口类型

 

 

 

7.健康监控

 

单元(即设备)健康监控

 

接口健康监控

 

 

8.部署方针

 

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

 

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

 

 

配置实例

 

.实验目的

 

 

 

.实验拓扑

 

PIX--failover

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

 

 

.实验步骤

 

 

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

<指定接口E2FO链路,接口名为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-SWfa1/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

--------------------------------------------查看R1telnet连接状况--------------------------------

R2>

[Connection to 202.100.1.1 closed by  foreign host]

<连接直接中断>

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

PIX1(config)#

         Switching to Standby

 

PIX1(config)#

         Switching to Active

<PIX1变为standbyPIX2变为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.

<PIX1变为standbyPIX2变为Active>

 

 

 

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

恢复正常的网络,开启R3-SWfa1/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

<FO不支持自动抢占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 telnetR2

R1#telnet 202.100.1.1

Trying 202.100.1.1 ... Open

 

 

User Access Verification

 

Password:

R2>

 

 

关闭R3-SWfa1/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>

<连接正常>

 

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

 

第二种情况:

另接一条线,设置成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 telnetR2

R1#telnet 202.100.1.1

Trying 202.100.1.1 ... Open

 

 

User Access Verification

 

Password:

R2>

 

 

关闭R3-SWfa1/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>

<连接正常>

 


推荐阅读:
  1. PIX506防火墙密码的破解
  2. PIX防火墙基本特性:失效处理机制和冗余-原理与实验

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

pix asa failover

上一篇:ELK 实验(一) 产品简介

下一篇:报表工具轻松搞定票据单据套打

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》