日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【网络知识点】防火墙主备冗余技术

發布時間:2024/4/13 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【网络知识点】防火墙主备冗余技术 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

【網絡知識點】防火墻主備冗余技術

本文以思科Failover技術為主備冗余技術,華為方面的主備冗余技術為VRRP+HRP,可自行查看華為相關配置資料,實際實現上兩者沒什么區別,只是實現原理上有點差別,華為做相互主備A/A會更容易些,如果思科做相互主備A/A需要用到多模式虛擬技術,較復雜一點。

A/S模式:

實驗環境

?

通過GNS3模擬搭建,防火墻鏡像為pix804.bin,路由器為c3640-jk9o3s-mz.124-10a.bin,交換機為c3640-jk9o3s-mz.124-10a.bin+交換端口板塊+no ip routing

?

注意:1.防火墻需要證書激活才能用更多功能:激活命令 ?activation-key 0xd2390d2c 0x9fc4b36d 0x98442d99 0xeef7d8b1 然后reload 2.需要測試ping的,防火墻要開啟ICMP協議修正,開啟ICMP狀態化檢測,命令為fixup protocol icmp

?

主要配置詳解:

主防火墻配置:

?

#配置內外接口地址

interface Ethernet0

?shutdown

?no nameif

?no security-level

?no ip address

?

interface Ethernet1

?nameif inside

?security-level 100

?ip address 192.168.1.254 255.255.255.0 standby 192.168.1.253 #必須有standby,用于檢測備用防火墻的端口地址,沒有standby它無法檢測主備端口狀態,然后根據狀態進行主備防火墻切換

?

interface Ethernet2

?nameif outside

?security-level 0

?ip address 100.1.1.1 255.255.255.0 standby 100.1.1.2

?

interface Ethernet3 - 4

No shut #3,4只需要noshut

?

#配置默認路由

route outside 0.0.0.0 0.0.0.0 100.1.1.3 1

route inside 1.1.1.1 255.255.255.255 192.168.1.1 1

?

#failover主要配置

failover

failover lan unit primary ?#定義主備,主備設備的配置差別就在這里而已

failover lan interface PZ Ethernet3 #配置配置同步端口

failover lan enable

failover key vrfxie #配置認證

failover link ZT Ethernet4 #配置狀態同步端口

failover interface ip PZ 10.1.12.1 255.255.255.0 standby 10.1.12.2

failover interface ip ZT 10.2.12.1 255.255.255.0 standby 10.2.12.2

?

備用防火墻配置:

failover

failover lan unit secondary

failover lan interface PZ Ethernet3

failover lan enable

failover key vrfxie

failover link ZT Ethernet4

failover interface ip PZ 10.1.12.1 255.255.255.0 standby 10.1.12.2

failover interface ip ZT 10.2.12.1 255.255.255.0 standby 10.2.12.2

?

其他什么都不用配置!開啟e34端口后它會自動同步主防火墻配置,這是整個配置的關鍵點,很多小伙伴多手配置了e1,2導致配置與主沖突,failover失敗

最后no shut e3,4端口,開始同步,出現以下信息則同步成功

Detected an Active mate

Beginning configuration replication from mate.

End configuration replication from mate.

?

測試:

關閉主防火墻上下聯交換機的端口或斷開其鏈路,主防火墻出現以下信息

pixfirewall(config)#

Switching to Standby

然后備變成activie,恢復主防火墻上下聯交換機的端口或對應鏈路,然后關閉備防火墻上下聯交換機的端口或斷開其鏈路,主防火墻重新變為activite

Switching to Active

切換時間大概為30左右,對于實際商業應用來說,不大理想!可能是模擬器的原因,真機也許不會這么慢。

?

R1在故障前保持與R2TCP連接,故障切換后,TCP不需要重新連接能接著使用

?

測試成功!

?

分析:

0.對比VRRP+透明模式防火墻來做主備防火墻,其切換時間稍微慢了一些,但他有狀態備份,業務連接在主備切換后不需要重新連接

1.切換機制:outsideinside兩邊分別進行輪詢檢測,如果檢測到對方的接口壞了才會切換,切換時間GN3模擬測試是30秒左右。PS:心跳線壞了,輪詢是好的,那是不會切換的

2.防火墻的切換不會搶占的,切換后就算主好了也不會恢復,需要使用命令fiallover active來手工切換回來?

3.默認跟蹤所有物理接口,如果有子接口需要通過monitor-interface來配置

?

A/A模式:

實現環境:

?

通過GNS3模擬搭建,防火墻鏡像為pix804.bin,路由器為c3640-jk9o3s-mz.124-10a.bin,交換機為c3640-jk9o3s-mz.124-10a.bin+交換端口板塊+no ip routing

?

此架構更符合實際運用,兩個防火墻之間相互冗余備份,雙activite雙出口,不會浪費一邊得帶寬資源,實在要找缺點的話就是需要兩邊帶寬要求比較高,畢竟故障發生時,一邊要承擔所有的流量,要規劃好。

?

主要配置詳解:

這里的交換機部分配置就不展示了,很簡單的配置,幾乎都是二層交換來用,重點在防火墻通過多模式實現相互主備的配置

PIX1配置:

mode multiple?#切換防火墻到多模式,才可以配置虛擬子防火墻

interface Ethernet0等等??#將所有要關聯到子防火墻的接口no shut

no shutdown

failover group 1 #配置failover 1最多創建兩個failover group

??Primary??#1primary物理設備為上開啟搶占功能,先成active

??Preempt ?#發生failover,原來由active狀態變為standby狀態此時將failover或者設備為正常,primary設備上的加入到組1子防火墻搶占active

failover group 2

??Secondary ??#2secondary物理設備上開啟搶占功能優先preempt成為active

??Preempt

?

admin-context admin ?#配置管理子防火墻,后面的admin可隨便寫,admin-context意思是創建管理子防火墻

context admin ?#進入admin子防火墻配置

??config-url flash:/admin.cfg ????#配置文件存儲目錄????

?

context c1 ?#配置子防火墻,命令名c1

??allocate-interface Ethernet0 ?#關聯相關物理接口子墻,這樣在子墻里才能看到有接口下同

??allocate-interface Ethernet3

??config-url flash:/c1.cfg

??join-failover-group 1 ?#c1墻加入到failover group?1

?

context c2 ?#同上

??allocate-interface Ethernet0

??allocate-interface Ethernet4

??config-url flash:/c2.cfg

??join-failover-group 2

?

?

Failover #看上面A/S的解釋

failover lan unit primary

failover lan interface PZ Ethernet1

failover lan enable

failover key vrfxie

failover link ZT Ethernet2

failover interface ip PZ 10.1.12.1 255.255.255.0 standby 10.1.12.2

failover interface ip ZT 10.2.12.1 255.255.255.0 standby 10.2.12.2

#分析:通過failover的狀態鏈和配置鏈來讓右邊去同步左邊的配置,那就不需要右邊再配一次,狀態鏈和配置鏈是所有子防火墻共用的

?

PIX2防火墻配置:

show model??#查看防火墻是在多模式下還是單模式下

mode multiple#改變防火墻到多模式下工作

failover

failover lan unit secondary

failover lan interface PZ Ethernet1

failover lan enable

failover key vrfxie

failover link ZT Ethernet2

failover interface ip PZ 10.1.12.1 255.255.255.0 standby 10.1.12.2

failover interface ip ZT 10.2.12.1 255.255.255.0 standby 10.2.12.2

?

PIX2只需no shut e1,2口,等待PIX12同步!

?

PIX2防火墻配置完成,完成這些步驟后,兩臺防火墻開始選舉各自的ActiveStandby。選舉完成后PXI1防火墻c1墻成為Active狀態c2Standby狀態PIX2c1成為Standby狀態c2Active狀態。所的配置Active角色的子墻配置,Standby狀態的子墻只能查看配置同步Active配置并檢測Active健康狀態,做好切換的準備。

?

查看failover狀態,在各自防火墻的主體(changeto system)上查看:

pixfirewall/pri/act(config)# show failover

Failover On

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

Failover unit Primary

Failover LAN Interface: PZ Ethernet1 (up)

Unit Poll frequency 15 seconds, holdtime 45 seconds

Interface Poll frequency 5 seconds, holdtime 25 seconds

Interface Policy 1

Monitored Interfaces 4 of 250 maximum

Version: Ours 8.0(4), Mate 8.0(4)

Group 1 last failover at: 15:28:42 UTC Mar 23 2017

Group 2 last failover at: 14:34:48 UTC Mar 23 2017

?

??This host: ???Primary

??Group 1 ??????State: ?????????Active

????????????????Active time: ???3615 (sec)

??Group 2 ??????State: ?????????Standby Ready

????????????????Active time: ???525 (sec)

?

??c1 Interface outside (100.1.1.1): Normal (Waiting)

??c1 Interface inside (192.168.10.254): Normal (Waiting)

??c2 Interface outside (100.1.1.4): Normal

??c2 Interface inside (192.168.20.253): Normal

?

??Other host: ??Secondary

??Group 1 ??????State: ?????????Standby Ready

????????????????Active time: ???150 (sec)

??Group 2 ??????State: ?????????Active

????????????????Active time: ???3240 (sec)

?

??c1 Interface outside (100.1.1.3): Normal (Waiting)

??c1 Interface inside (192.168.10.253): Normal (Waiting)

??c2 Interface outside (100.1.1.2): Normal

??c2 Interface inside (192.168.20.254): Normal

?

?

配置c1c2子防火墻的IP和路由,均要在處于Active狀態的子防火墻上配置,處于Standby狀態的不能做任何配置

?

prompt hostname priority state context#修改“#”前面的顯示字符,在物理設備下配置,這樣便于查看

?

PIX1配置c1

changeto context c1#切換到c1子防火墻進行配置

?

interface Ethernet0 ???#參考上面A/S的解析,一樣的

?nameif outside

?security-level 0

?ip address 100.1.1.1 255.255.255.0 standby 100.1.1.3

?

interface Ethernet3

?nameif inside

?security-level 100

?ip address 192.168.10.254 255.255.255.0 standby 192.168.10.253

?

PIX2配置c2

changeto context c2

?

interface Ethernet0

?nameif outside

?security-level 0

?ip address 100.1.1.2 255.255.255.0 standby 100.1.1.4

?

interface Ethernet4

?nameif inside

?security-level 100

?ip address 192.168.20.254 255.255.255.0 standby 192.168.20.253

?

?

最后路由要配置好,這里路由的配置我就分享了,基本都是配默認路由

?

測試:

斷開PIX1的上聯交換機口

恢復該交換機口

?


?

分析:

1.切換成功,恢復后,可以自動恢復原來狀態,這點跟A/S模式不一樣!

2.切換速度很快!5秒內!

3.對比A/S模式,無論從架構還是效率上都有很大優勢


如果本文中有什么問題,歡迎留言交流!謝謝!

轉載于:https://blog.51cto.com/vrfxie/1909860

總結

以上是生活随笔為你收集整理的【网络知识点】防火墙主备冗余技术的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。