I wanted to host few gameservers on my home network to play with my buddies, the thing is having a public ip is like begging to get DDoS'ed, so what ive done is i have set up a OpenVPN server on a DDoS protected vps with ip 98.158.113.x. My home server public ip is 143.12.44.x.
I have used these iptables rules to forward traffic from the vps to my home server via OpenVPN:
IVSS 7730
iptables -t nat -A PREROUTING -d 98.158.113.x -p udp --dport 7730 -j DNAT --to-dest 10.8.0.2:7730 iptables -t nat -A POSTROUTING -d 10.8.0.2 -p udp --dport 7730 -j SNAT --to-source 10.8.0.1
10.8.0.1 is the OpenVPN gateway i think and 10.8.0.2 is the ip my home server has got from the OpenVPN server.
The problem here is that when someone connects to the server his ip is listed as 10.8.0.1 instead of his real ip.
Is there any way i can fix that?
iptables -t nat -D POSTROUTING -d 10.8.0.2 -p udp --dport 7730 -j SNAT --to-source 10.8.0.1