第一次架 Wireguard 實戰紀錄

Suifeng0214 Lv3

背景

因為在交大修 NA ,VPN 章節有介紹到 Wireguard,在得知它支援跨平台後,就決定我的行動裝置 RDP 就靠它了!

瓶頸

總之大概是遇到了下列瓶頸:

  • 對設計網路架構缺乏經驗和相關知識QQ
  • 這個網站 誤導以為 Client config 的 endpoint 可以不用填@@
  • 不確定 Server 和 Client 的 config 裡 AllowedIPs 怎麼設計比較符合需求
  • 把 Server config 裡面兩個 Peer 的 AllowedIPs 設成一樣的 CIDR
    導致兩個根本有一個沒辦法連上 Server 一開始還沒發現..

反正最後是成功設定完了來筆記點過程 :D

1
2
3
4
5
6
7
8
iptables -t nat -A PREROUTING -i <interface> -p tcp --dport <listenport> -j DNAT --to-destination <connectip>:3389 # Port Forwarding

qrencode -t ansiutf8 < wg0.conf # Generate QR config

vim /etc/sysctl.conf # ipv4.ip_forward=1
sysctl -p # apply

systemctl enable wg-quick@wg0.service # connect on boot
On this page
第一次架 Wireguard 實戰紀錄