LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-25-2010, 04:01 PM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Rep: Reputation: 33
Unable to start iptables


I am unable to start iptables :

Code:
-bash-3.2# /sbin/chkconfig --list | grep ip
iptables       	0:off	1:off	2:on	3:on	4:on	5:on	6:off
multipathd     	0:off	1:off	2:off	3:off	4:off	5:off	6:off
-bash-3.2# /etc/rc.d/init.d/iptables status
Firewall is stopped.
-bash-3.2# /etc/rc.d/init.d/iptables start
-bash-3.2# /etc/rc.d/init.d/iptables status
Firewall is stopped.
-bash-3.2# /etc/init.d/iptables status
Firewall is stopped.
-bash-3.2# /etc/init.d/iptables start
-bash-3.2# /etc/init.d/iptables status
Firewall is stopped.
This is the version of iptables :
Code:
-bash-3.2# rpm -qa iptables
iptables-1.3.5-5.3.el5_4.1
Do I have a problem with my kernel ?
Code:
-bash-3.2# uname -r
2.6.18-164.11.1.el5xen
Code:
-bash-3.2# ls /usr/src/kernels/
2.6.18-164.11.1.el5-x86_64  2.6.18-164.11.1.el5-xen-x86_64  2.6.18-164.11.1.el5xen-x86_64
If this is a kernel-problem, how do I enable iptables for my kernel ??
 
Old 02-25-2010, 04:52 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
service iptables start

has it ever started ?

if not you need to create the iptables file

Code:
[root@bigboy tmp]# touch /etc/sysconfig/iptables
[root@bigboy tmp]# chmod 600 /etc/sysconfig/iptables

[root@bigboy tmp]# service iptables start
Applying iptables firewall rules: [  OK  ]
[root@bigboy tmp]#

http://www.linuxhomenetworking.com/w..._Won.27t_Start

But of course they will be empty !
 
Old 02-25-2010, 05:04 PM   #3
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
This what I have :
Code:
-bash-3.2# ls -l /etc/sysconfig/ | grep ipta
-rw------- 1 root root 1740 Nov  2 13:17 iptables-config
Isn't there a default file for iptables ??
 
Old 02-25-2010, 05:31 PM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
I would have thought so. But if it's never been run, then it might not have any rules.
Check the iptables-config file to see if the autosave section is disabled.
Either way you will have to create some rules.

Have you got a gui to set the firewall up with ?
 
Old 02-26-2010, 02:49 AM   #5
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by smoker View Post
I would have thought so. But if it's never been run, then it might not have any rules.
Check the iptables-config file to see if the autosave section is disabled.
/etc/sysconfig/iptables-config contains :
Code:
IPTABLES_SAVE_ON_STOP="no"
IPTABLES_SAVE_ON_RESTART="no"
Do I need to change ? Or else I will loose my config every time ?

To manage I will use CSF.
 
Old 02-26-2010, 03:17 AM   #6
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
Hi jonaskellens,

Hope you are using Redhat family of distros. So the place of your iptables and iptables-config are correct.

My iptables-config file is here, which is working fine for me, You can compare it to yours

Code:
IPTABLES_MODULES="nf_conntrack_ftp nf_conntrack_netbios_ns"
IPTABLES_MODULES_UNLOAD="yes"
IPTABLES_SAVE_ON_STOP="no"
IPTABLES_SAVE_ON_RESTART="no"
IPTABLES_SAVE_COUNTER="no"
ITABLES_STATUS_NUMERIC="yes"
IPTABLES_STATUS_VERBOSE="no"
IPTABLES_STATUS_LINENUMBERS="yes"
How about this ?
Code:
# /sbin/iptables -nvL

Last edited by vinaytp; 02-26-2010 at 03:33 AM.
 
Old 02-26-2010, 06:40 AM   #7
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
It doesn't matter if your iptables-config line has that as you can manually save any rules you add.
Those lines are just for anything you add after it starts, but don't want to persist on a reboot.

Find a safe iptables set up from somewhere and copy it in to your iptables
save the file then type
Code:
service iptables save
Code:
service iptables restart
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables doesn't start behzadfu Linux - Server 35 06-29-2009 02:06 AM
unable to re-install iptables (novice help) renree Fedora 4 06-14-2009 04:04 PM
NFS through iptables: unable to configure it guarriman Fedora 1 12-06-2006 03:28 AM
unable to configure firewall using IPTABLES adityavpratap Slackware 5 05-29-2006 11:21 AM
can not start my iptables xudingding Linux - Security 6 10-13-2005 03:30 PM


All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration