2024年8月26日 星期一

RouterOS WireGuard

RouterOS 在 7 版以後支援 WireGuard
註: WireGuard 在 Linux Kernel 5.6 版開始內建

設定滿簡單的,在選單 WireGuard New Interface,Private Key 及 Public Key 不用填,會自動產生
在 IP / Addresses 綁一個 IP 給 wireguard1,例如 10.66.66.1/24
在 IP / Firewall / NAT 加上 srcnat 讓 wireguard1 區段 masquerade

在 Peer 加 Client,這邊就沒有自動產生功能,
要找一台有裝 wireguard-tools 的 Linux,用 wg 指令產生
wg genkey | tee privatekey # 產生 Private Key
wg pubkey < privatekey # 產生 Public Key
wg genpsk # 產生 Preshared Key

Client Address 填入 10.66.66.2 # 要在上面 wireguard1 網段內
Client DNS 填入 8.8.8.8
Client Endpoint 填入 RouterOS 的 Public IP
下面會自動產生 Client Config 及 Client QR 碼

但實測在 [Interface] 內 ListenPort 必需移除才會通,
掃 QR 碼後,需將 ListenPort (監聽連接埠) 設定移除,移除後欄位會呈現 (隨機)

ref. ROS WireGuard

沒有留言:

Certificate lifetime reduce to 47 days after 2029-03-15

在 2020年九月,憑證效期縮短為 398 天 爾後最新標準是 47 天,原因一樣是資安考量,分三個階段逐步調整 執行時間表 2026-03-15 縮短成 200 天 2027-03-15 縮短成 100 天 2029-03-15 縮短成 47 天 圖片來源 Sectigo r...