Convert iptables line to command-line syntax for CSF bash script -


this question command-line iptables syntax. have following chains in /etc/sysconfig/iptables

# generated iptables-save v1.4.21 on fri may 22 07:51:03 2015 *nat :prerouting accept [0:0] :postrouting accept [0:0] commit 

but need them write bash csfpre.sh csf firewall, should in command-line like

iptables -t nat -i postrouting -s 192.168.254.0/24 -o br0 -j snat --to-source 69.64.56.847 

or

iptables -a forward -s 192.168.254.0/24 -m state --state new -j accept 

but lines above have stumbling block. tried like

iptables :prerouting accept [0:0] iptables -t nat -i :prerouting accept [0:0] 

but no success.

    iptables -p prerouting accept 

says

iptables: bad built-in chain name. 

so still not solution. in advance hint else try

after tests solution was

iptables -t nat -p prerouting accept iptables -t nat -p postrouting accept 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -