我有一個運行WireGuard VPN (PiVPN + Pi-hole+ Unbound) 的VPS(在我的家庭網路之外),並且我正在嘗試設定連接埠轉送以提高torrent 效能(就像ProtonVPN 和AirVPN 等服務提供的服務一樣) 。我的 Windows 10 電腦是用戶端,它位於路由器後面。
我已經在路由器上配置了連接埠轉發,但我很難讓它在我的 VPS 上正常工作。有人可以提供有關如何為此目的在我的 VPS 上設定連接埠轉送的逐步指南嗎?
到目前為止我已經嘗試過以下但沒有運氣
iptables -t nat -A PREROUTING -i enp0s6 -p tcp --dport 32554 -j DNAT --to-destination 10.221.178.2
iptables -t nat -A POSTROUTING -p tcp --dport 32554 -d 10.221.178.2 -j MASQUERADE
附加資訊:
OS and Network info:
OS running on VPS: Ubuntu 22.04.4 LTS
OS running on PC: WIndows 10
VPS public ip: 1.2.3.4
WireGuard interface: wg0
IPv4 address for wg0: 10.221.178.1
Network adapter on VPS: enp0s6
IPv4 address for enp0s6: 10.0.0.18
Port used for incoming connections on qbittorrent: 32554
Iptables rules on server: https://rentry.co/pniz3pkn
Wireguard Config:
:::: Server configuration shown below ::::
[Interface]
PrivateKey = server_priv
Address = 10.221.178.1/24,fd11:5ee:bad:c0de::1/64
MTU = 1420
ListenPort = 51820
### begin zephyrus-m ###
[Peer]
PublicKey = zephyrus-m_pub
PresharedKey = zephyrus-m_psk
AllowedIPs = 10.221.178.2/32,fd11:5ee:bad:c0de::2/128
### end zephyrus-m ###
=============================================
:::: Client configuration shown below ::::
[Interface]
PrivateKey = zephyrus-m_priv
Address = 10.221.178.2/24,fd11:5ee:bad:c0de::2/64
DNS = 10.221.178.1
[Peer]
PublicKey = server_pub
PresharedKey = zephyrus-m_psk
Endpoint = REDACTED:51820
AllowedIPs = 0.0.0.0/0, ::0/0