LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   iptables error (https://www.linuxquestions.org/questions/linux-server-73/iptables-error-895232/)

kirthika 08-03-2011 02:04 AM

iptables error
 
root@linux-laptop:/home/linux# service iptables status
iptables: unrecognized service

Why is it so??
Please do help me..

EricTRA 08-03-2011 02:10 AM

Hello,

It would help us a lot if you indicate what distro and version you are using. Check if you have iptables installed as root with:
Code:

which iptables
(should be in /sbin if I'm not mistaking). Then check if you have a startup script for iptables in /etc/init.d.

Kind regards,

Eric

kirthika 08-03-2011 02:18 AM

Thanks for reply...
I am using Ubuntu 10.04 Lucid Lynx. I want to check if firewall is enabled in my laptop.

linux@linux-laptop:~$ which iptables
/sbin/iptables

How to check if I have startup script for iptables??

EricTRA 08-03-2011 03:38 AM

Hi,

Check if you have file named iptables in /etc/init.d.

Kind regards,

Eric

kirthika 08-03-2011 03:55 AM

In /etc/init.d I dont find iptables.
What does it mean??

eSelix 08-03-2011 04:02 AM

In Ubuntu the firewall is always enabled, it is not a service - it is a kernel feature, enabled during compilation. But besides enabled firewall you need to write some rules for it and execute them after each reboot, for example as network interface startup script. Programming rules is simple, for example:
Code:

iptables -P INPUT DENY # By default do not allow to anybody to start connection with your machine
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT # By default allow you connecting to anywhere from your machine
iptables -A INPUT -p TCP --dport 80 -j ACCEPT # Allow anybody to connect to your machine on port 80

This is only example, you can also find some high level tools to administer iptable rules.


All times are GMT -5. The time now is 05:29 PM.