I want to apply those iptables rules with Salt:
iptables -t nat -A PREROUTING -p tcp --dport 21 -j REDIRECT --to-port 2121
iptables -t nat -A PREROUTING -p tcp --dport 25 -j REDIRECT --to-port 1025
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-port 1137
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-port 1138
iptables -t nat -A PREROUTING -p tcp --dport 139 -j REDIRECT --to-port 1139
iptables -t nat -A PREROUTING -p tcp --dport 445 -j REDIRECT --to-port 1445
I have the following state:
alfresco-iptables:
iptables.append:
- table: nat
- chain: PREROUTING
- proto: tcp
- dport: 21
- jump: REDIRECT
- to-port: 2121
It fails with this output:
[DEBUG ] Results of YAML rendering:
OrderedDict([('alfresco-iptables', OrderedDict([('iptables.append', [OrderedDict([('table', 'nat')]), OrderedDict([('chain', 'PREROUTING')]), OrderedDict([('proto', 'tcp')]), OrderedDict([('dport', 21)]), OrderedDict([('jump', 'REDIRECT')]), OrderedDict([('to-port', 2121)])])]))])
[INFO ] Executing state iptables.append for alfresco-iptables
[INFO ] Executing command 'iptables -t nat -C PREROUTING --proto tcp --to-port 2121 --jump REDIRECT --dport 21 --__env__ sandbox --__sls__ sged01 --order 10000 ' in directory '/root'
[DEBUG ] output: iptables v1.3.5: Unknown arg `-C'
Try `iptables -h' or 'iptables --help' for more information.
[INFO ] Executing command 'iptables -t nat -A PREROUTING --proto tcp --to-port 2121 --jump REDIRECT --dport 21 --__env__ sandbox --__sls__ sged01 --order 10000 ' in directory '/root'
[DEBUG ] output: iptables v1.3.5: Unknown arg `--to-port'
Try `iptables -h' or 'iptables --help' for more information.
First thing.. "save: True" (from the doc) failed.
Then, Unkown arg -C ?
Any clue ?
Thanks !