PDA

View Full Version : iptables weirdness


allan
06-26-03, 03:13 PM
I am having problem with IPTables choking on my variables, or more specifically, my variable.

I am running IPTables on a Virtuozzo VPS, I created (err...copied) a basic IPTables ruleset. The only variable I left in place is:

IPTABLES="/sbin/iptables"


When I try to restart IPTables I get the following error:


[root@vbind allan]# /etc/rc.d/init.d/iptables restart
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules:
Bad argument `PTABLES="/sbin/iptables'
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]


BUT, if I take out the variable and replace it with /sbin/iptables (and I did verify that iptables is located in the /sbin directory I still get an error:


[root@vbind allan]# /etc/rc.d/init.d/iptables restart
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules:
Bad argument `/sbin/iptables'
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]



Any thoughts?

James
06-28-03, 09:15 PM
hrmmm im not an expert on this but i think it might be an error in the table it self. try opeing it up once and check it out for dups or missing IP numbers i think i had that happen to a friend of mine once.
good luck
James

allan
07-02-03, 10:00 PM
I figured it out, I was trying to issue the commands directly in /etc/sysconfig/iptables, instead of running them as a script. I moved them into a script and all seems fine now.