I'm setting up an OpenVPN server. I want it to redirect any incoming connection (except for ports 22 (ssh) and 1194 (the VPN server itself)) to a client connected to the VPN.
The VPN server will live at vpn.example.com The client is at 10.8.0.2, the VPN gateway is 10.8.0.1
How do I setup a DMZ to do this ?
Footnotes :
I found how to redirect a single port over the VPN here: Port forwarding with OpenVPN
The gist is to run iptables -t nat -A PREROUTING -i eth0 -d VPN_IP_HERE -p tcp --dport PORT_TO_REDIRECT -j DNAT --to-destination 10.8.0.2
However, this only works for one port at a time, I woud love a solution like --dport *