CentOS and iptables


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
41 views
Gentlemen, I decided then to get acquainted with centos, actually need to configure iptables, it's all just principle, and on other systems does not cause problems, but then came to a screeching halt. opened documentation
wiki.centos.org/HowTos/Network/IPTables
in fact all is clear, create the script, write the rule from the example, the result is:
./firewall.sh: line 7: iptables: command not found
and so all commands that are not so can not understand

centos 5.5 final
by | 41 views

6 Answers

0 like 0 dislike
which iptables what gives?
And check whether the path in the PATH variable.
by
0 like 0 dislike
Correct the scripts to do:
IPT=/sbin/iptables (or other)
\r
$IPT (the rule)
$IPT (the rule)
by
0 like 0 dislike
The most simple — whereis iptables
and then in the script add the first
IPTABLES=/sbin/iptables (or more General option —
IPTABLES=`whereis -b iptables | cut-d" " -f2`
) and then use in design
$IPTABLES -A <...>
by
0 like 0 dislike
sudo?
by
0 like 0 dislike
Root script launch?
\r
If you don't. Start from the root.
Full path to iptables: /sbin/iptables
by
0 like 0 dislike
sudo chmod 755 firewall.sh
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
asked Aug 4, 2019 by Vlad1983
110,608 questions
257,186 answers
0 comments
22,960 users