使用 iptables puppet 模块,我需要使用什么语法来允许本地主机上的端口从 443 重定向到 8443?
看起来它的语法应该是如下的但我不确定如何将其转换成清单。
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 8443
现有的傀儡规则:
firewall { '100 tomcat rewrite 443 to 8443':
table => 'nat',
chain => 'PREROUTING',
jump => 'REDIRECT',
proto => 'tcp',
dport => '443',
toports => '8443',
}
firewall { '100 allow access to tomcat 8443 https':
proto => 'tcp',
state => ['NEW'],
dport => '8443',
action => 'accept',
}
答案1
firewall {'XXX rule':
destination => '127.0.0.1',
dport => '443',
proto => 'tcp',
chain => 'OUTPUT',
table => 'nat',
jump => 'REDIRECT',
toports => '8443'
}