有關 FortiGate 防火牆相關設定

  • 設備型號 : FortiGate 40C (v5.2.13,build762)
  • WAN1 : 220.100.100.100 GW: 220.100.100.254
  • LAN(Internal) : 192.168.0.1
  • 設定 WAN1 (wan1)
  • 設定 LAN (intrtnal)
  • 設定 Default Route
    • System → Network → Routing
      • Create New :
        • Destination IP/Mask : 0.0.0.0/0.0.0.0
        • Device : wain1
        • Gateway : 220.100.100.254
    • Policy & Objects → Policy → IPV4
      • Create New :
        • Incoming Interface : internal
        • Source Address : all
        • Outgoing Interface : wan1
        • Destination Address : all
        • Schedule : always
        • Service : ALL
        • Action : ACCEPT
  • 預計設定 WAN1 的 Port 80 / 443 → 192.168.0.200:80 / 443
  • 定義 VIP : Polocy & Objects → Objects → Virtual IPs
    1. 建立 VIP : web-http 與 web-https 看畫面
    2. 建立 VIP Group : webserver-group 看畫面
    3. 完成 VIP 建立 看畫面
    4. 確認與建立 Services : HTTP/HTTPS 看畫面
  • 定義 Policy : Policy & Objects → Policy → IPv4
    1. 建立 wan1→internal port mapping Policy 看畫面
    2. 完成 wan1→internal port mapping Policy 看畫面
  • 如果 Policy 中有啟動 NAT 轉過去的內部 Server 來源 IP 就會是 Fortigate 的 IP
    • Exp. Fortigate 的 internal IP 是 192.168.0.1 在 21/May/2018:11:29:57 切換成有 NAT 的規則, 結果 Web Server Log 內看到的來源 IP 都變成 192.168.0.1 看畫面
  • 建立使用者 :
    1. User & Device → User → User Group
      • Create New :
        • Name : vpn-user
        • Type : Firewall
    2. User & Device → User → User Definition
      • Create New :
        1. User Type : Local User
        2. Login Credentials :
          • User Name : vpnuser1
          • Password : password1
        3. Contact Info :
        4. Extra Info :
          • [V] Enable
          • [ ] Two-factor Authentication
          • [V] User Group : vpn-user
  • VPN → SSL → Portals
    • Create New1) :
      • Name : ichiayi-sslvpn
      • [V] Enable Tunnel Mode
        • [V] Enable Split Tunneling
          • Routing Address : SSLVPN_TUNNEL_ADDR1
        • Source IP Pooles : SSLVPN_TUNNEL_ADDR1
      • Client Options : [V] A;ways Up (Keep Alive)
      • [V] Enable Web Mode
      • Portal Message : Welcome to SSL VPN Service
  • 設定帳號一次只能一個連線 :
    • VPN → SSL → Portals → 選擇指定的項目 Exp. full-access → Edit
    • [V] Limit Users to One SSL-VPN Connection at a Time
  • 連上 Fortigate 查看有經過這 FW 的 IP 流量訊息 Exp. 192.168.0.250
    diag debug reset
    diag debug flow filter clear
    diagnose sniffer packet any "host 192.168.0.250 and icmp" 4
  • 可以在外部 192.168.1.140 的 Windows 10 PC 執行 ping 與 tracert , 只要有經過 Fortigate 就會顯示流量訊息
    • ping 範例 PC 端
    • tracert 範例 PC 端
  • 參考手冊 - fortigate-ha-56.pdf
  • 設定前確認
    1. 兩台 FortiGate 的 Firmware 版本必須相同 Exp. v5.2.13,build762
    2. 兩台 FortiGate 的網路介面要先設定成固定 IP (不要 DHCP / PPPoE), 如果設定 Active-Passive 模式等 HA 建立完成後可再改回 DHCP or PPPoE2)
    3. 兩台 FortiGate 的設定幾乎相同 (Exp. 只有 hostname / Internal IP 不同 / wan IP 不同)
    4. 尚未設定 VDOM / HA CLI 語法
  • 預計設定的 HA 架構與模式
    • 設定 HA 的模式 : FGCP Active-Active HA (這模式最多可以設定到四台 FortiGate3))
    • 配置架構圖
  • 設定方式
    1. 每一台都登入啟用 HA CLI 語法
    2. 設定好 fortigate 應該會自動重開機
    3. 經過一小段時間 HA 燈號會亮起 (如果是綠燈表示 HA 正常, 橘燈表示 HA 異常)
    4. 檢查 HA 相關資訊狀態 CLI 語法
    5. 連上 Slave 檢查 HA 相關狀態 CLI 語法
    6. 如果沒問題, 就可以將 wan1 改成 PPPoE 模式, 以及 Internal 啟動 DHCP Server4)
  • 如果對自動選擇的 Master 不滿意, 可以透過設定 priority 來指定(越大的數值優先當 Master) Exp. CLI語法
  • 取消(解除) HA 設定
    • 直接連入要移除的那台 fortigate 執行系統重設 CLI語法
    • 連入將 ha mode 設定 standlone CLI語法

1)
免費只能建立一組, 預設是 full-access
2)
fortigate-ha-56.pdf Page.28
3)
fortigate-ha-56.pdf Page.24
4)
Active-Active 模式 wan1 介面無法使用 PPPoE
  • tech/fortigate_tips.txt
  • 上一次變更: 2024/03/09 22:06
  • jonathan