I have a machine running debian 8. I want to forward the packets that arrive to the IP (interface tun0) to the IP (interface eth0).

I have tried the following iptables rules, but unsuccessfully (the rules are not even saved to iptables checking with --list option):

iptables -t nat -A PREROUTING -p tcp -s 0/0 -d --dport 12004 -j DNAT --to
iptables -t nat -A POSTROUTING -o eth0 -d -j SNAT --to-source

Is there anything wrong in the rules above?

  • What exactly you want to achieve ? I believe you want to do port forward via openvpn? – fugitive Jan 11 '17 at 20:10
  • Exactly. I want to connect to through openvpn. – giovi321 Jan 11 '17 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.