LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   iptables: command not found? (https://www.linuxquestions.org/questions/linux-newbie-8/iptables-command-not-found-85050/)

GT_Onizuka 08-24-2003 12:30 AM

iptables: command not found?
 
okay im trying to configure mah firewall using iptables but for some reason it keeps telling me the command cannot be found. i checked in my service configuration thing and it says iptables is running (unfortunately not with the settings i want) and i can see while my computer is booting up/shutting down that it starts/stops iptables respectively. anyone know whats up?

jqcaducifer 08-24-2003 12:41 AM

Maybe your kernel isn't set up right.

Go to /usr/src/linux
become root
type "make xconfig"
select the tab Networking Options
make sure "Network packet filtering" is enabled

for more iptables options, scroll down to the tab "IP: Netfilter Configuration"

If "Network packet filtering" isn't enabled, you have to enable it, and recompile the kernel. Search around for how to

nightjar 08-24-2003 01:26 AM

Re: iptables: command not found?
 
Quote:

Originally posted by GT_Onizuka
okay im trying to configure mah firewall using iptables but for some reason it keeps telling me the command cannot be found.

which command?

i checked in my service configuration thing and it says iptables is running (unfortunately not with the settings i want) and i can see while my computer is booting up/shutting down that it starts/stops iptables respectively. anyone know whats up?

Are you trying to run your own firewall?

Tesl 08-24-2003 04:15 AM

make sure the iptables directory is in your PATH variable, if it isnt already. try:

Code:

PATH=$PATH:<directoryname>
(EDIT - i think i might have read this wrong. Do you mean the command isnt working, or you just dont know the name of the command itself?)

GT_Onizuka 08-24-2003 10:16 AM

i know the name of the command and i have a book that tells me what i need to put in to make my own rules for a firewall. on a previous install it worked without a single problem. but, for some reason, this time it says the command iptables is not found.

Mathieu 08-24-2003 10:55 AM

Use the whereis command to find the location of iptables
Code:

whereis iptables

GT_Onizuka 08-24-2003 12:22 PM

iptables: /sbin/iptables /lib/iptables /usr/share/man/man8/iptables.8.gz

this is what it gives me. do i have to be in one of these directories for iptables to work or something?

Mathieu 08-24-2003 12:42 PM

No.
I just wanted to make sure that iptables was installed correctly.

First of all, are you logged-in as root when you try to use the command ?
By default, only root has the /sbin directory in its path.
As root, type:
Code:

echo $PATH
Hopefully, the /sbin will be present.

GT_Onizuka 08-24-2003 03:03 PM

yeah i am running as root and i think when i did the command you suggested the results are rather ungood :p

/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/ynadji/bin

i dont see /sbin, which you were talking about earlier. im just wondering wtf i did...

david_ross 08-24-2003 03:11 PM

If you are suing to root the use:
su -

Not:
su

This loads root's paths which includes /sbin without that you can run:
/sbin/iptables

GT_Onizuka 08-24-2003 04:13 PM

yep that did it thanks a bunch ^_^


All times are GMT -5. The time now is 06:07 PM.