Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running CentOS 5. when I type

iptables -L

i get

Usage: iptables {start|stop|restart|condrestart|status|panic|save}

what's wrong with it?

share|improve this question

2 Answers 2

Can you tell us your $PATH, and the output of which iptables? At first glance, it looks to me as if you're picking up /etc/init.d/iptables in preference to /sbin/iptables .

If you are, the fix is to find out how /etc/init.d is getting into your PATH, and remove it. It may seem attractive to have it in there, but there's much too much potential for picking up the wrong thing (eg, sendmail, where you'll likely pick up the service startup script instead of the actual MTA binary, and commands like sendmail -q -v will go wrong as well).

share|improve this answer
    
this is almost certainly what's happening. –  Sirex Nov 26 '10 at 14:19

try this:

From your user account:

su - 

iptables -L

Cent doesnt add /sbin/ into the path of user accounts by default like other distros do, so I bet you logged in as yourself, the got root access through some means that didnt properly update your environment(or your tried to add wierd things to your path to fix the problem before posting) and now your running the init script for iptables. The above mentod gets you root access with roots environment.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.