Answer the question
In order to leave comments, you need to log in
How to wrap all traffic in the tunnel, except for 1 port?
I installed OpenVPN on the VPS and wrapped all traffic in a tunnel to get a white IP.
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth0 -p tcp -d xxx.xxx.xxx.xxx -j DNAT --to 10.8.0.2
Answer the question
In order to leave comments, you need to log in
Use ! to allocate an ssh port, similar to what you did for the subnet in destination.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question