High Availability, FortiManager, routage avancé, debug — maîtrisez FortiGate au niveau expert
HA Groups, heartbeat, synchronisation, failover
| Mode | Description | Avantages |
|---|---|---|
| Actif/Passif (A/P) | Un seul appareil actif, l'autre en attente | Simple, basculement rapide |
| Actif/Actif (A/A) | Deux appareils actifs, load-balancing | Meilleure utilisation des ressources |
Heartbeat : Le lien de redondance entre les deux FortiGate, via un port dédié (recommandé) ou un port existant.
Le mode actif-passif, avec un seul actif, une configuration synchronisée et un basculement rapide et lisible.
HA group, priority, override, session pickup
# === Primary (Master) ===
FGT60F # config system ha
FGT60F (ha) # set mode a-p
FGT60F (ha) # set group-name "Cluster_Prod"
FGT60F (ha) # set priority 200
FGT60F (ha) # set override enable
FGT60F (ha) # set hbdev "ha1" 0
FGT60F (ha) # set session-sync enable
FGT60F (ha) # set route-wait enable
FGT60F (ha) # set route-ttl 10
FGT60F (ha) # set hello-holddown 20
FGT60F (ha) # set ha-uptime-diff-factor 5
FGT60F (ha) # set ha-device-id-factor mac
FGT60F (ha) # set unicast-hb enable
FGT60F (ha) # end
# === Secondary (Slave) ===
FGT60F # config system ha
FGT60F (ha) # set mode a-p
FGT60F (ha) # set group-name "Cluster_Prod"
FGT60F (ha) # set priority 100
FGT60F (ha) # set override enable
FGT60F (ha) # set hbdev "ha1" 0
FGT60F (ha) # end
# Verifier le statut HA
FGT60F # get system ha status
FGT60F # diagnose sys ha dump-by vcluster
FGT60F # diagnose sys ha dump-by peer
Que le membre à 200 reprend la main après retour, sans flottement, car la préemption est autorisée et déterministe.
Sync config, session sync, failover trigger
# Forcer la synchronisation
FGT60F # execute ha manage 0
FGT60F # diagnose sys session sync clear
FGT60F # execute fabric-restart
# Forcer un failover
FGT60F # execute ha failover
# Diagnostiquer la synchro
FGT60F # diagnose sys ha dump-by vcluster
FGT60F # diagnose sys ha dump-by peer
FGT60F # diagnose sys ha dump-by mtx
# Synchronisation des sessions
# Mode 0 : session-sync (toutes les sessions)
# Mode 1 : session-sync-exclude (exclure certaines)
# Mode 2 : session-sync-filter (inclus only)
FGT60F # config system ha
FGT60F (ha) # set session-sync enable
FGT60F (ha) # set session-sync-dev "ha1"
FGT60F (ha) # end
# Logs HA
FGT60F # execute log filter field type system
FGT60F # execute log filter field module ha
FGT60F # execute log display
Que la configuration est synchronisée, que les sessions sont répliquées et que la fenêtre de maintenance est validée avec un plan de retour.
Dépannage HA, split-brain, heartbeat
# Diagnostic HA
FGT60F # diagnose sys ha dump-by vcluster
FGT60F # diagnose sys ha dump-by peer
FGT60F # diagnose sys ha dump-by mtx
FGT60F # diagnose sys ha dump-by status
# Tester le heartbeat
FGT60F # execute ping 10.0.0.2
# Verifier la synchro
FGT60F # diagnose sys session sync list
FGT60F # diagnose sys session sync status
# Forcer la synchro
FGT60F # execute fabric-restart
Deux unités maîtresses simultanées, causées en premier par la coupure ou l instabilité du lien heartbeat.
ADOM, provisioning, installations, scripts
FortiManager permet de gérer plusieurs FortiGate depuis une console centralisée.
# Enregistrer FortiManager depuis FortiGate
FGT60F # config system central-management
FGT60F (central-management) # set type fortimanager
FGT60F (central-management) # set fmg "192.168.40.10"
FGT60F (central-management) # set fmg-source-ip 192.168.40.1
FGT60F (central-management) # end
# Verifier la connexion
FGT60F # diagnose debug application fnbam-daemon -1
FGT60F # diagnose debug enable
# Mode normal (mode managed)
FGT60F # execute central-mgmt run local -manage enable
# Installer les packages
FGT60F # config system central-management
FGT60F (central-management) # set focal-fortigate
FGT60F (central-management) # set enable-fmg-access enable
FGT60F (central-management) # end
Le diff avec la configuration locale, le bon ADOM cible et une sauvegarde permettant un retour arrière rapide.
Stockage logs, rapports, dashboards, SOAR
# Envoyer les logs a FortiAnalyzer
FGT60F # config log fortianalyzer setting
FGT60F (setting) # set status enable
FGT60F (setting) # set server 192.168.40.20
FGT60F (setting) # set source-ip 192.168.40.1
FGT60F (setting) # set serial "FAZ-XXXXXXXX"
FGT60F (setting) # set upload-option realtime
FGT60F (setting) # set interface-select-mode auto
FGT60F (setting) # set reliable-enable enable
FGT60F (setting) # end
# Verifier la connexion FortiAnalyzer
FGT60F # diagnose test application forticloudlogger 3
# Logs locaux en complement
FGT60F # config log disk setting
FGT60F (setting) # set status enable
FGT60F (setting) # set diskfull erase
FGT60F (setting) # set max-logsize 500
FGT60F (setting) # end
Pour garantir la livraison des logs même en cas de microcoupure réseau, sans trou dans la piste d audit.
Security Fabric, Fabric Connectors, automation
# Configurer le Security Fabric
FGT60F # config fabric-interconnect
FGT60F (interconnect) # set status enable
FGT60F (interconnect) # set device-id 1
FGT60F (interconnect) # set group-name "Fabric_Prod"
FGT60F (interconnect) # end
# Fabric Connectors
FGT60F # config fabric connector
FGT60F (connector) # edit 1
FGT60F (1) # set name "Syslog_Connector"
FGT60F (1) # set type syslog
FGT60F (1) # set server 10.0.1.200
FGT60F (1) # set port 514
FGT60F (1) # set protocol udp
FGT60F (1) # next
FGT60F (connector) # end
# Automation Stitch
FGT60F # config automation-trigger
FGT60F (trigger) # edit "High_CPU_Alert"
FGT60F (High_CPU_Alert) # set event-type event-log
FGT60F (High_CPU_Alert) # set logid 0100022000
FGT60F (High_CPU_Alert) # next
FGT60F (trigger) # end
FGT60F # config automation-action
FGT60F (action) # edit "Send_Email"
FGT60F (Send_Email) # set action-type email
FGT60F (Send_Email) # set email-to admin@example.com
FGT60F (Send_Email) # set email-from fortigate@example.com
FGT60F (Send_Email) # set email-server mail.example.com
FGT60F (Send_Email) # next
FGT60F (action) # end
FGT60F # config automation-stitch
FGT60F (stitch) # edit "CPU_High_Stitch"
FGT60F (CPU_High_Stitch) # set trigger "High_CPU_Alert"
FGT60F (CPU_High_Stitch) # set action "Send_Email"
FGT60F (CPU_High_Stitch) # next
FGT60F (stitch) # end
Un trigger qui détecte, une action qui exécute et un stitch qui les relie avec journalisation.
Routes statiques,策略路由, SD-WAN zones
# Routes statiques
FGT60F # config router static
FGT60F (static) # edit 1
FGT60F (1) # set dst 0.0.0.0/0
FGT60F (1) # set gateway 192.168.1.1
FGT60F (1) # set device port1
FGT60F (1) # set distance 10
FGT60F (1) # set priority 1
FGT60F (1) # next
FGT60F (static) # edit 2
FGT60F (2) # set dst 0.0.0.0/0
FGT60F (2) # set gateway 192.168.2.1
FGT60F (2) # set device port3
FGT60F (2) # set distance 20
FGT60F (2) # set priority 2
FGT60F (2) # next
FGT60F (static) # end
# Policy Routing
FGT60F # config router policy
FGT60F (policy) # edit 1
FGT60F (1) # set input-device port2
FGT60F (1) # set src 10.0.1.0/24
FGT60F (1) # set dst 0.0.0.0/0
FGT60F (1) # set gateway 192.168.1.1
FGT60F (1) # set output-device port1
FGT60F (1) # next
FGT60F (policy) # end
# SD-WAN Zones
FGT60F # config system sdwan
FGT60F (sdwan) # set status enable
FGT60F (sdwan) # config zone
FGT60F (zone) # edit "WAN_Zone"
FGT60F (WAN_Zone) # set interface "port1" "port3"
FGT60F (WAN_Zone) # next
FGT60F (zone) # end
FGT60F (sdwan) # config members
FGT60F (members) # edit 1
FGT60F (1) # set interface "port1"
FGT60F (1) # set zone "WAN_Zone"
FGT60F (1) # set gateway 192.168.1.1
FGT60F (1) # set priority 1
FGT60F (1) # next
FGT60F (members) # edit 2
FGT60F (2) # set interface "port3"
FGT60F (2) # set zone "WAN_Zone"
FGT60F (2) # set gateway 192.168.2.1
FGT60F (2) # set priority 2
FGT60F (2) # next
FGT60F (members) # end
FGT60F (sdwan) # end
# Performance SLA
FGT60F # config system sdwan
FGT60F (sdwan) # config health-check
FGT60F (health-check) # edit "SLA_Internet"
FGT60F (SLA_Internet) # set server 8.8.8.8
FGT60F (SLA_Internet) # set protocol ping
FGT60F (SLA_Internet) # set interval 1000
FGT60F (SLA_Internet) # set probe-timeout 1000
FGT60F (SLA_Internet) # set failure 3
FGT60F (SLA_Internet) # next
FGT60F (health-check) # end
FGT60F (sdwan) # end
Pour ne basculer que sur un lien réellement joignable, mesuré par ping vers une cible fiable, et éviter les bascules sur un lien monté mais muet.
Routage dynamique, neighbours, areas, redistribution
# OSPF Configuration
FGT60F # config router ospf
FGT60F (ospf) # set router-id 10.0.1.1
FGT60F (ospf) # config area
FGT60F (area) # edit 0.0.0.0
FGT60F (0.0.0.0) # set type regular
FGT60F (0.0.0.0) # next
FGT60F (area) # end
FGT60F (ospf) # config network
FGT60F (network) # edit 1
FGT60F (1) # set prefix 10.0.1.0/24
FGT60F (1) # set area 0.0.0.0
FGT60F (1) # next
FGT60F (network) # edit 2
FGT60F (2) # set prefix 10.0.2.0/24
FGT60F (2) # set area 0.0.0.0
FGT60F (2) # next
FGT60F (network) # end
FGT60F (ospf) # config redistribute "connected"
FGT60F (ospf) # set status enable
FGT60F (ospf) # end
# BGP Configuration
FGT60F # config router bgp
FGT60F (bgp) # set as 65001
FGT60F (bgp) # set router-id 10.0.1.1
FGT60F (bgp) # config neighbor
FGT60F (neighbor) # edit "10.0.2.1"
FGT60F (10.0.2.1) # set remote-as 65002
FGT60F (10.0.2.1) # set soft-reconfiguration enable
FGT60F (10.0.2.1) # next
FGT60F (neighbor) # end
FGT60F (bgp) # config network
FGT60F (network) # edit 1
FGT60F (1) # set prefix 10.0.1.0/24
FGT60F (1) # next
FGT60F (network) # end
FGT60F (bgp) # end
# Verification
FGT60F # get router info routing-table ospf
FGT60F # get router info bgp summary
FGT60F # get router info bgp neighbors
Le voisinage, l AS distant, le network déclaré et les filtres, avec get router info bgp neighbors et summary.
Outils de diagnostic, capture paquets, debug
# Ping depuis le FortiGate
FGT60F # execute ping 10.0.1.100
FGT60F # execute ping-options source 10.0.1.1
FGT60F # execute ping 10.0.1.100
FGT60F # execute ping-options repeat-count 10
FGT60F # execute ping-options data-size 1400
FGT60F # execute ping-options timeout 5
FGT60F # execute ping 10.0.1.100
# Traceroute
FGT60F # execute traceroute 8.8.8.8
FGT60F # execute traceroute-options max-ttl 20
FGT60F # execute traceroute-options timeout 2
FGT60F # execute traceroute 10.0.1.100
# Sniffer packet
FGT60F # diagnose sniffer packet port1 'host 10.0.1.50' 4 0 l
FGT60F # diagnose sniffer packet any 'tcp port 443' 6 0 a
# Debug packet flow
FGT60F # diagnose debug flow filter addr 10.0.1.50
FGT60F # diagnose debug flow show function-name enable
FGT60F # diagnose debug flow show function-name enable
FGT60F # diagnose debug flow trace start 100
FGT60F # diagnose debug enable
# Voir les resultats
FGT60F # diagnose debug disable
Ping passerelle puis Internet, traceroute, sniffer ciblé, debug flow filtré, puis lecture des politiques et des routes.
Pipeline de traitement des paquets, debug flow
Le packet flow de FortiGate suit un pipeline précis :
# Debug flow — captures le pipeline complet
FGT60F # diagnose debug flow filter addr 10.0.1.50
FGT60F # diagnose debug flow filter port 443
FGT60F # diagnose debug flow show interface-name enable
FGT60F # diagnose debug flow show timestamp enable
FGT60F # diagnose debug flow trace start 10
FGT60F # diagnose debug enable
# Exemple de sortie debug flow
# id=2030 msg="policy 1 match" action=accept
# id=2030 msg="Created session"
# id=2030 msg="NAT" src=10.0.1.50 dst=142.250.80.46
# id=2030 msg="send"
# id=2030 msg="policy 1 accept"
# Diagnostique des erreurs courantes
FGT60F # diagnose debug application fnbamd -1
FGT60F # diagnose debug application sslvpn -1
FGT60F # diagnose debug application ike -1
Que la bonne règle est trouvée mais qu une étape suivante comme UTM, NAT ou route refuse ou échoue, à inspecter dans les lignes suivantes.
Monitoring CPU, mémoire, sessions, NP/CP offload
# Performance systeme
FGT60F # get system performance status
FGT60F # get system performance top
# Historique CPU
FGT60F # diagnose sys cpu-history
# Sessions actives
FGT60F # diagnose sys session info
FGT60F # diagnose sys session list
FGT60F # diagnose sys session stat
# Offload hardware (NP6)
FGT60F # diagnose hardware deviceinfo np6
FGT60F # diagnose npu np6 dme info
# Statistiques CP (Content Processor)
FGT60F # diagnose hardware deviceinfo cp
# Memoire et buffers
FGT60F # diagnose hardware deviceinfo memory
FGT60F # diagnose sys flash list
# Table ARP
FGT60F # get system arp
# Table MAC
FGT60F # get system interface mac
Charge CPU, mémoire et nombre de sessions, croisés avec l état de l offload matériel NP et CP.
Scénarios réels, méthodologie, check-list
show system interfaceget router info routing-table allexecute ping 8.8.8.8show firewall policydiagnose debug flow filter srcip 10.0.1.50show vpn ipsec phase1-interfaceget router info routing-table allexecute ping vers le peerdiagnose debug application ike 255get vpn ssl settings | grep portshow vpn certificateshow user localexecute log displayLa vérification de la configuration et de l état avec show ou get, avant tout debug, pour écarter une erreur de paramétrage évidente.
Types de logs, filters, syslog, FortiAnalyzer
# Types de logs
# - Traffic (forward, local, multicast)
# - Event (system, VPN, HA, etc.)
# - UTM (AV, IPS, Web, App)
# - Anomaly
# Configuration des logs
FGT60F # config log setting
FGT60F (setting) # set fuzzy-log disable
FGT60F (setting) # set user-anonymize disable
FGT60F (setting) # set per-packet-logging disable
FGT60F (setting) # end
# Logs sur disque
FGT60F # config log disk setting
FGT60F (setting) # set status enable
FGT60F (setting) # set max-logsize 500
FGT60F (setting) # set diskfull erase
FGT60F (setting) # set roll-over enable
FGT60F (setting) # end
# Filtrer les logs
FGT60F # execute log filter type forward
FGT60F # execute log filter field action denied
FGT60F # execute log filter start 0
FGT60F # execute log filter limit 50
FGT60F # execute log display
# Syslog distant
FGT60F # config log syslogd setting
FGT60F (setting) # set status enable
FGT60F (setting) # set server 10.0.1.200
FGT60F (setting) # set port 514
FGT60F (setting) # set mode udp
FGT60F (setting) # set reliable enable
FGT60F (setting) # end
Filtrer type forward et action denied, fixer start et limit à 50, puis display, avec export vers syslog ou FortiAnalyzer pour l historique.