I'm trying to put a middle server or a proxy between my client and the wireguard server.
I don't want to directly connect to the Wireguard endpoint from my own computer.
If the wireguard endpoint is for examle 2.2.2.2:2408 I want my client to connect to 3.3.3.3:1200 (my vps) and then the connection gets forwarded to the destination endpoint.
wireguard client > middle server with port forwarding > destination server
Tried iptables to forward the port 1200 on my vps to wireguard server IP:PORT with no luck:
iptables -t nat -A PREROUTING -p udp --dport 1200 -j DNAT --to-destination 2.2.2.2:2408
I was told i may need to rewrite the source using SNAT to the ip of the middle server but I'm not sure how to do that.
Tried iptables to forward the port 1200 on my vps to wireguard server IP:PORT with no luck:
iptables -t nat -A PREROUTING -p udp --dport 1200 -j DNAT --to-destination 2.2.2.2:2408
I was told i may need to rewrite the source using SNAT to the ip of the middle server but I'm not sure how to do that.