I am setting up a VPS for VPN purposes. The idea is to lift as many limits as possible on public networks.
One idea is to redirect the incoming OpenVPN connections on port 53 to the default OpenVPN port.
Here is how I imagined it:
I am currently trying to figure out either iptables or UFW rules to achieve this.
I am honestly not sure if this would be enough. The idea is to mimic DNS queries. Additional features/ideas would be to relay to something like iodine.
Would love to hear some feedback if anyone ever implemented something similar!
Cheers.
To redirect a network stream from one port to another, you may use the following rule:
iptables -t nat -A PREROUTING -i <your public network interface> -p udp --dport 53 -j REDIRECT --to-ports 1194
iptables -t nat -A PREROUTING -s \! <your private network> -p udp --dport 53 -j REDIRECT --to-ports 1194
Note that you may also have to add some rules in the FORWARD
tables to authorize the stream.