0

I have a dedicated server which hosts game servers, and is vulnerable to DDoS attacks. I want to get a DDoS-protected VPS to act as a reverse proxy for UDP. The dedicated server's IP address is 7.7.7.7 and the VPS's IP address is 9.9.9.9.

The whole idea is to hide the 7.7.7.7 address, so that it's not visible to the public when connecting to my game servers. When players connect, they should be sending packets to 9.9.9.9 and receiving packets from 9.9.9.9. If 7.7.7.7 was visible, hackers could directly attack it and bypass my reverse proxy. I don't want to "route" the UDP packets. I don't care if all the players will come from the same IP address.

Is there any way I can do this on Linux? If so, what commands?

1
  • A proxy server is aware of the protocol and understands the requests it's processing, typically providing you with a method to manipulate those requests as well. What you're asking for is network address translation.
    – HBruijn
    Feb 11, 2015 at 8:17

1 Answer 1

3

I've used this combination of rules to proxy port 27015:

iptables -t nat -A PREROUTING -p udp --dport 27015 -j DNAT --to-destination 7.7.7.7:27015

iptables -t nat -A POSTROUTING -j MASQUERADE

Originally, I thought the 7.7.7.7 address was not being hidden. But I confirmed that the proxy was working properly, using Wireshark.

Not the answer you're looking for? Browse other questions tagged .