Hi ALL

I want to use iptables module to manage port forwarding

---->  EXT_IP:EXT_PORT  ---->   INT_IP:INT:PORT

If user request  EXT_IP with port 8001, it will forward to INT_IP ( 
192.168.100.131 ) and port 22. 

I use iptables module but fail

*#* ansible   -m iptables   -a 'table=nat   chain=PREROUTING   protocol=tcp 
  match=tcp   destination_port=8001   jump=REDIRECT 
to_destination=192.168.100.131   to_ports=22'   gateway   --ask-pass


gateway | FAILED! => {

    "changed": false, 

    "cmd": "/usr/sbin/iptables -t nat -A PREROUTING -p tcp -m tcp -j 
REDIRECT --to-destination 192.168.100.131 --destination-port 8001 
--to-ports 22", 

    "failed": true, 

    "msg": "iptables v1.4.21: unknown option \"--to-destination\"\nTry 
`iptables -h' or 'iptables --help' for more information.", 

    "rc": 2, 

    "stderr": "iptables v1.4.21: unknown option \"--to-destination\"\nTry 
`iptables -h' or 'iptables --help' for more information.\n", 

    "stdout": "", 

    "stdout_lines": []

}


I already check https://docs.ansible.com/ansible/iptables_module.html


Pleas tell me which option I should use?



Thanks


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d445d5a8-787c-45b3-b41f-7ab20987c73c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to