You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.
I have exactly the opposite issue - if the target is at the end and there's any option depending on that target, rule fails to compile, e.g. --to-ports depends on MASQUERADE or REDIRECT target:
[root@localhost vagrant]# iptables-restore < /etc/sysconfig/iptables
iptables-restore v1.4.21: unknown option `--to-ports'
Error occurred at line: 31
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
I'm running on CentOS 6.4 with the very latest version of iptables - 1.4.21 compiled directly from the latest dev snapshot.
Which version/OS are you running?
Maybe there's just a difference between versions...
The text was updated successfully, but these errors were encountered:
Hi Radek, reading through iptables documentation, I understand that --to-ports and --random are extra options to the TARGETsMASQUERADE and REDIRECT specifically, and cannot be written before them. This is in accordance with your findings and explains them:
In your example the TARGET is actually REDIRECT --to-ports 8000 and not just REDIRECT (as --to-ports is a parameter of the TARGET itself and not of the CHAINNAT). The same happens with other TARGETs, that accept extra options.
A quick fix (using exactly your same example) would be:
This would be worth some further explanation 552e151, @javierbertoli
I have exactly the opposite issue - if the target is at the end and there's any option depending on that target, rule fails to compile, e.g.
--to-ports
depends onMASQUERADE
orREDIRECT
target:I'm running on CentOS 6.4 with the very latest version of iptables - 1.4.21 compiled directly from the latest dev snapshot.
Which version/OS are you running?
Maybe there's just a difference between versions...
The text was updated successfully, but these errors were encountered: