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?


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).

  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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