0

I have a machine running debian 8. I want to forward the packets that arrive to the IP 10.10.12.12:12004 (interface tun0) to the IP 192.168.0.158:12004 (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 10.10.12.12 --dport 12004 -j DNAT --to 192.168.0.158:12004
iptables -t nat -A POSTROUTING -o eth0 -d 192.168.0.158 -j SNAT --to-source 10.10.12.12

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 192.168.0.158 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.