-
設定前確認
兩台 FortiGate 的 Firmware 版本必須相同 Exp. v5.2.13,build762
兩台 FortiGate 的網路介面要先設定成固定 IP (不要 DHCP / PPPoE), 如果設定 Active-Passive 模式等 HA 建立完成後可再改回 DHCP or PPPoE
2)
兩台 FortiGate 的設定幾乎相同 (Exp. 只有 hostname / Internal IP 不同 / wan IP 不同)
尚未設定 VDOM / HA
CLI 語法 get system ha status
ichiayi-02-FG40C # get system ha status
Model: FortiGate-40C
Mode: standalone
Group: 0
Debug: 0
ses_pickup: disable
number of vcluster: 0
預計設定的 HA 架構與模式
設定 HA 的模式 : FGCP Active-Active HA (這模式最多可以設定到四台 FortiGate
3))
配置架構圖
graph TD
Internet["Internet"]
Router["VDSL Router"]
FG1["Fortigate 40c
ichiayi-01-FG40C"]
FG2["Fortigate 40c
ichiayi-02-FG40C"]
Switch["Internal Switch"]
PC1["PC or NB"]
AP["Wi-Fi AP"]
PC2["PC or NB"]
Internet <-->|"WAN"| Router
Router -->|"Static IP (wan1)"| FG1
Router -->|"Static IP (wan1)"| FG2
FG1 <-->|"wan2 HA 連線"| FG2
FG1 -->|"Internal"| Switch
FG2 -->|"Internal"| Switch
Switch --> PC1
Switch --> AP
Switch --> PC2
style Internet fill:#e1f5ff,stroke:#333,stroke-width:3px
style Router fill:#fff4e1,stroke:#333,stroke-width:2px
style FG1 fill:#cce5ff,stroke:#333,stroke-width:2px
style FG2 fill:#d4f1d4,stroke:#333,stroke-width:2px
style Switch fill:#ffe1e1,stroke:#333,stroke-width:2px
style PC1 fill:#f0f0f0,stroke:#333,stroke-width:2px
style AP fill:#fff0cc,stroke:#333,stroke-width:2px
style PC2 fill:#f0f0f0,stroke:#333,stroke-width:2px
設定方式
每一台都登入啟用 HA
CLI 語法 config system ha
set group-id 10
set mode a-a
set hbdev wan2 50
set group-name ichiayi_cluster
set load-balance-all enable
set password **Password**
end
設定好 fortigate 應該會自動重開機
經過一小段時間 HA 燈號會亮起 (如果是綠燈表示 HA 正常, 橘燈表示 HA 異常)
檢查 HA 相關資訊狀態
CLI 語法 get system ha status
Model: FortiGate-40C
Mode: a-a
Group: 10
Debug: 0
ses_pickup: disable
load_balance: enable
load_balance_udp: disable
schedule: Round robin.
upgrade_mode: unset
Master:128 ichiayi-01-FG40C FGT40C391xxxxxx5 1
Slave :128 ichiayi-02-FG40C FGT40C391xxxxxx1 0
number of vcluster: 1
vcluster 1: work 169.254.0.2
Master:0 FGT40C391xxxxxx5
Slave :1 FGT40C391xxxxxx1
get system ha
ichiayi-01-FG40C # get system ha
group-id : 10
group-name : ichiayi_cluster
mode : a-a
password : *
hbdev : "wan2" 50
session-sync-dev :
route-ttl : 10
route-wait : 0
route-hold : 10
sync-config : enable
encryption : disable
authentication : disable
hb-interval : 2
hb-lost-threshold : 6
helo-holddown : 20
gratuitous-arps : enable
arps : 5
arps-interval : 8
session-pickup : disable
update-all-session-timer: disable
session-sync-daemon-number: 1
link-failed-signal : disable
uninterruptible-upgrade: enable
ha-mgmt-status : disable
ha-eth-type : 8890
hc-eth-type : 8891
l2ep-eth-type : 8893
ha-uptime-diff-margin: 300
vcluster2 : disable
vcluster-id : 1
override : disable
priority : 128
schedule : round-robin
monitor :
pingserver-monitor-interface:
pingserver-failover-threshold: 0
pingserver-slave-force-reset: enable
pingserver-flip-timeout: 60
load-balance-all : enable
get system status
ichiayi-01-FG40C # get system status
Version: FortiGate-40C v5.2.13,build0762,171212 (GA)
Virus-DB: 52.00006(2017-09-28 20:11)
Extended DB: 1.00000(2012-10-17 15:46)
IPS-DB: 12.00234(2017-09-28 01:27)
IPS-ETDB: 0.00000(2001-01-01 00:00)
Serial-Number: FGT40C391xxxxxx5
Botnet DB: 1.00000(2012-05-28 22:51)
BIOS version: 04000006
System Part-Number: P08924-05
Log hard disk: Not available
Internal Switch mode: switch
Hostname: ichiayi-01-FG40C
Operation Mode: NAT
FIPS-CC mode: disable
Current HA mode: a-a, master
Branch point: 762
Release Version Information: GA
System time: Sat Jun 16 16:17:52 2018
連上 Slave 檢查 HA 相關狀態
CLI 語法 execute ha manage 0
ichiayi-01-FG40C # execute ha manage 0
ichiayi-02-FG40C login: admin
Password: ********
Welcome !
get system status
ichiayi-02-FG40C # get system status
Version: FortiGate-40C v5.2.13,build0762,171212 (GA)
Virus-DB: 52.00006(2017-09-28 20:11)
Extended DB: 1.00000(2012-10-17 15:46)
IPS-DB: 12.00234(2017-09-28 01:27)
IPS-ETDB: 0.00000(2001-01-01 00:00)
Serial-Number: FGT40C391xxxxxx1
Botnet DB: 1.00000(2012-05-28 22:51)
BIOS version: 04000009
System Part-Number: P08924-09
Log hard disk: Not available
Internal Switch mode: switch
Hostname: ichiayi-02-FG40C
Operation Mode: NAT
FIPS-CC mode: disable
Current HA mode: a-a, backup
Branch point: 762
Release Version Information: GA
System time: Sat Jun 16 16:20:05 2018
如果沒問題, 就可以將 wan1 改成 PPPoE 模式, 以及 Internal 啟動 DHCP Server4)
如果對自動選擇的 Master 不滿意, 可以透過設定 priority 來指定(越大的數值優先當 Master)
Exp. CLI語法 連入後先將 Master 設定 200config system ha
set priority 200
end
切換到 Slave 設定 255(最大值)
execute ha manage 1
config system ha
set priority 255
end
會斷掉一下, 重新登入後可以看到已經切換
TPFortiGate40C-1 # get system ha status
Model: FortiGate-40C
Mode: a-a
Group: 10
Debug: 0
ses_pickup: disable
load_balance: enable
load_balance_udp: disable
schedule: Round robin.
upgrade_mode: unset
Master:255 TPFortiGate40C-1 FGT40C391xxxxxx7 1
Slave :200 TPFortiGate40C-2 FGT40C391xxxxxx1 0
number of vcluster: 1
vcluster 1: work 169.254.0.2
Master:0 FGT40C391xxxxxx7
Slave :1 FGT40C391xxxxxx1
<file>
取消(解除) HA 設定
直接連入要移除的那台 fortigate 執行系統重設
CLI語法 exec factoryreset
ichiayi-02-FG40C # exec factoryreset
This operation will reset the system to factory default!
Do you want to continue? (y/n)y
連入將 ha mode 設定 standlone
CLI語法 config system ha
set mode standalone
end
這樣設定之後, 就解除掉 HA 模式, 每一台 fortigate 的 internal / wan1 IP 都相同, 所以可以透過 Internal IP 連入的是 master 那台, 若想在遠端以原本 Internal IP 連上其他 slave 必須將可連入的 fortigate 修改 Internal IP 就能用原本 Internal IP 連入.