您好,登錄后才能下訂單哦!
Failover
概述
Failover與我們前面學習的HSRP很像,都可以說是提供故障恢復的功能。
1.Active與Standby
設備的健康狀況是通過LAN-FO接口來監控的(類似于心跳線,也是通過一條線來連接兩個PIX,實現狀態監控、復制配置、狀態轉移);
兩個設備一個被配置為Primary設備,另一個作為Secondary設備(Primary和Secondary是一個物理概念);
一個設備被選為Active(轉發流量),另一個被選為Standby(等待、備份)。兩個狀態為邏輯概念;
如何成為Active?
當一臺防火墻啟動的時候,就開始了一個選舉的進程(以下都是基于兩臺設備為健康狀態)
如果檢測多一個正在協商的設備處于FO的另一端,此時Primary設備成為Active狀態并轉發數據,Secondary設備成為Standby狀態,成為備份設備;
如果檢測到一個Active設備,自己轉換為Standby狀態;
如果在FO的另一端沒有檢測到設備,自己成為Active狀態;
如果成為Active后,檢測到FO另一端有Active設備,兩臺設備重新協商。
注:Primary、Secondary與Active、Standby的區分?
Primary、Secondary是物理概念,指的是物理設備本身在Failover中所處的角色;
Active、Standby是邏輯概念,指的是設備的狀態,是否處于轉發數據的狀態;
Active狀態不一定指的是Primary設備,也可以是Secondary設備,Standby狀態同理。
2.如何切換
正常切換
Active設備出現故障時,處于Standby的設備(如果是健康的)將成為Active轉發數據。
切換發生時
Standby設備在所有接口上繼承原來Active設備的屬性(IP和MAC);
但是,FO一臺口上的地址保持不變。
3.管理
只需在Active設備上進行配置即可;active設備上的配置都會自動被復制到Standby設備上;
通過Standby設備的standby IP可以對此設備進行基本的監控和管理
4.部署Failover設備的必要條件
硬件需求
相同硬件型號;
相同數量和類型的接口;
相同類型的SSM模塊;
相同內存。
軟件需求
相同操作模式;
相同主板和子版本。
授權需求
不必一樣的授權,只需FO授權即可。
5.部署方式
注:是針對FO接口來說的
無狀態化FO
僅僅只是普通的硬件冗余而已;
當故障切換發生時,所有已經建立的連接中斷,必須重新連接。
狀態化FO
提供更加強大的冗余---狀態會話表項的冗余;
故障切換時,連接依舊保持;用戶不必重新連接;
兩個設備之間需要提供一個狀態換鏈路(LAN-FO之外的其他鏈路)
6.接口類型
LAN-FO接口:確定每一個設備的運行狀態并復制和同步配置;
LAN-FO接口(狀態化接口):傳遞狀態信息到Standby設備,可以是一個獨立接口,也可以和其他接口共享,包括FO接口,但是不推薦,一般為獨立接口。
7.健康監控
單元(即設備)健康監控
通過監控FO鏈路來確認其他單元的健康狀況;
設備通過FO接口來交換Hello消息;
當收不到來自與Active設備的響應時,切換發生。
接口健康監控
每個網絡接口都可以被監控;
設備通過控制接×××換Hello消息
當Active設備上一個被指定為監控的接口出現故障時,切換發生。
8.部署方針
部署FO接口時,考慮如下的部署方針
可以使用密鑰來保護FO通訊
如果狀態化鏈路和FO鏈路共享接口,需要使用一個可用的高速率接口,最好不要讓 狀態化鏈路和普通數據接口共享一個物理接口;
調整FO的各項參數來實現快速切換
在Active和standby設備上手動置頂MAC地址,來阻止一些可能阻斷網絡流量的偶然事件
在所有連接防火墻設備的交換機接口上,考慮配置快速端口(PortFast)。
注:如果FO接口壞掉,那么Failover將不能實現故障恢復的功能,FO相當于整個Failover的心臟,具有不可替代的作用。
配置實例
一.實驗目的
了解Failover的原理、作用及使用;
掌握Failover的狀態化和無狀態化的區別;
理解并掌握Failover的LAN-FO接口的類型(兩種狀態)及其重要性;
掌握Faiover的配置。
二.實驗拓撲
如上:通過規劃、配置,用兩臺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變為standby,PIX2變為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變為standby,PIX2變為Active> |
狀態化
本實驗在無狀態化實驗的基礎上進行。
恢復正常的網絡,開啟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 <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 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> <連接正常> |
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。