使用軟體 opnsense
先前導讀相關 Blog
https://xrcd2.blogspot.com/2025/05/pfsense-fortigate.html
https://xrcd2.blogspot.com/2025/04/freeradius-google-authenticator-2fa.html
下載 ISO 用它開機後,使用 帳/密: installer / opnsense 進入安裝模式,如有使用二張網卡,預設 WAN port 會使用 DHCP 取得IP/GW/DNS等相關資訊,LAN port IP 預設則為 192..168.1.1/24 可以透過 browser 連入 OPNsense,可使用 帳/密: root / opnsense 登入OPNsense管理頁面.
接下來可以安裝 os-freeradius / os-net-snmp / os-net-snmp 等外掛,在安裝及設定完成後可以移除不使用的 WAN port ,以下這台OPNsense僅做 RADIUS 伺服器使用.
以下運用情境為 FortiGate VPN Client 透過 RADIUS 做 OTP 登入認證.
運作機制說明:使用者輸入密碼再加上 Google Authenticator APP 產生的 6 碼動態驗證碼(TOTP 協定)。[OTP 碼直接在密碼後面接者輸入即可.]
FortiGate 收到後將驗證請求轉發至後端的 RADIUS 伺服器(FreeRADIUS ).RADIUS 伺服器與綁定 Google Authenticator (OTP) 演算法的驗證比對後回傳驗證成功.
簡要架構說明:
FortiGate VPN Client ===>(密碼加OTP)===> Fortigate Firewall ===> RADIUS (OPNsense Plugin) ===> OPNsense 登入認證 (user id/pwd/otp)
重點一.必需將 OPNsense \System\ Access \ Servers 新增一個 OTP-Server
Type 為 Local + Timebased One Time Password
重點二. 必需將 OPNsense \System\ Access \ Users \ 新增一個使用者並
設定上密碼 及使用 OTP (這些資訊是用來提供 VPN 登入認證使用)
重點三. 不使用 OPNsense \ Services \ FreeRADIUS \ Users 這個功能.
Demo
沒有留言:
張貼留言