iptables v1.2.9: Unknown arg `/sbin/iptables'
Try `iptables -h' or 'iptables --help'
Dear friends,
I am facing a weird problem with iptables.
I wrote a script, which I have simplified as below:
#!/bin/sh
EXTDEV=eth0
EXTIP="60.49.232.254"
#!/bin/sh#!/bin/sh
EXTDEV=eth0
EXTIP="60.49.232.254"
INTDEV=eth1
INTIP="172.22.1.253"
IPT=/sbin/iptables
for table in mangle filter nat
do
$IPT -t $table -F
$IPT -t $table -X
$IPT -t $table -Z
done
$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP
$IPT -F
$IPT -X
$IPT -nat -A POSTROUTING -o eth0 -j SNAT --to-source $EXTIP
~
EXTDEV=eth0
EXTIP="60.49.232.254"
INTDEV=eth1
INTIP="172.22.1.253"
IPT=/sbin/iptables
for table in mangle filter nat
do
$IPT -t $table -F
$IPT -t $table -X
$IPT -t $table -Z
done
$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP
$IPT -F
$IPT -X
$IPT -nat -A POSTROUTING -o eth0 -j SNAT --to-source $EXTIP
~
INTDEV=eth1#!/bin/sh
EXTDEV=eth0
EXTIP="60.49.232.254"
INTDEV=eth1
INTIP="172.22.1.253"
IPT=/sbin/iptables
for table in mangle filter nat
do
$IPT -t $table -F
$IPT -t $table -X
$IPT -t $table -Z
done
$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP
$IPT -F
$IPT -X
$IPT -nat -A POSTROUTING -o eth0 -j SNAT --to-source $EXTIP
~
INTIP="172.22.1.253"
IPT=/sbin/iptables
for table in mangle filter nat
do
$IPT -t $table -F
$IPT -t $table -X
$IPT -t $table -Z
done
$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP
$IPT -F
$IPT -X
$IPT -nat -A POSTROUTING -o eth0 -j SNAT --to-source $EXTIP
Problem: Whenever i try to load this script by doing ./firewall it gives me the following error:
iptables v1.2.9: Unknown arg `/sbin/iptables'
Try `iptables -h' or 'iptables --help'
I have checked, there is the /sbin/iptables in there.
Yesterday it worked perfectly, I didn't change anything on my computer, but today it can no longer work. I tired with different scripts, but still don't work.
Searched google but feeds nothing useful, anyone know what went wrong? pleas ehelp me...thank a lot for taking time reading my thread..
Regards
Yong
|