Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.