Answer the question
In order to leave comments, you need to log in
How to write Iptables rules to direct OpenVPN server traffic to SSH tunnel?
An OpenVPN server has been set up on an Ubuntu 20.04 server.
Open SSH tunnel to remote host
autossh -M 20000 -D 127.0.0.1:1080 -q -N [email protected]
-t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
-A FORWARD -i tun0 -j ACCEPT
-A FORWARD -i tun0 -o eth0 -s 10.8.0.0/24 -j ACCEPT
-A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -j REJECT
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question