I’ve made wireguard tu nel out to VPS (to circumvent CGNAT). Dns server works, web server + Gitea, Jellyfin,… works. All the stuff running on my thin Ubuntu client. What doesn’t work is forwarding the RDP port to my windows machine. No firewall on the windows machine. Used to work before CGNAT got enabled by my ISP. I’ve tried also UDP port, but still no connection.
Here is my wg0 conf:
[Interface] PrivateKey = … Address = 10.1.0.2/24
PostUp = iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to-destination 192.168.1.21:3389; iptables -t nat -A POSTROUTING -p tcp --dport 3389 -j MASQUERADE
PostDown = iptables -t nat -D PREROUTING -p tcp --dport 3389 -j DNAT --to-destination 192.168.1.21:3389; iptables -t nat -D POSTROUTING -p tcp --dport 3389 -j MASQUERADE
[Peer] PublicKey = … AllowedIPs = 0.0.0.0/0 Endpoint = …oraclevpsIP…:55108 PersistentKeepalive = 25
Does the machine running the WireGuard tunnel to the VPS acts as a “router” aka gateway for the network? Otherwise the windows machine doesn’t have a return path for the connection.
I’ve got 4G modem. It runs DHCP/gateway for the network. From that it is a mix of wifi routers, one dumb switch and things sitting on powerline connected parts of the network (outside wifi routers for power monitor, guest wifi round the property, etc). All is running on 192.168.1.xx , only the wg0 interface is 10.1.0.2. My ubuntu server runs just my web server, adguard home, jellyfin, etc.
I would advise that you instead also connect the Windows machine to the VPS with WireGuard as 10.1.0.3, basically mirroring what you’ve done on the Ubuntu server. The routing will be a mess otherwise. Another option is running the WireGuard tunnel on your gateway with something like OPNsense.