LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-02-2009, 04:30 PM   #1
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
iptables doesn't start on boot up


OK, I'm stumped on this one, can't seem to see the problem.

Running CentOS 5.3 and its upto date as of 10 minutes ago.

If I reboot it, everything comes back up but if I run iptables -L it shows me a blank tables list:

Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
If I start the iptables service and run the same command my tables are back. I've checked ntsysv and ensured that iptables is ticked there, I've also done chkconfig and turned it on, my chkconfig output for iptables is:

Code:
iptables       	0:off	1:off	2:on	3:on	4:on	5:on	6:off
Couldn't find anything in /var/log/message either.

Any ideas?
 
Old 08-02-2009, 08:34 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
After you load your rules, you need to save them using service iptables save as mentioned here. After that, it'll do what you are expecting.
 
Old 08-03-2009, 01:39 AM   #3
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Just setup the firewall, then save the setup:

/etc/init.d/iptable save and then set it to start at boot:

chkconfig iptables on.

This should do the job.
 
Old 08-03-2009, 04:43 AM   #4
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Original Poster
Rep: Reputation: 18
You two were quite correct. Forgot you had to do that, I'd been putting it into /etc/sysconfig/iptables setting the service up and just expecting it to load.

Odd how you have to save them first, it does however remove my comments from the iptables script. Is this why it was broken?
 
Old 08-03-2009, 04:50 AM   #5
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Quote:
Originally Posted by Lee_Ball View Post
You two were quite correct. Forgot you had to do that, I'd been putting it into /etc/sysconfig/iptables setting the service up and just expecting it to load.

Odd how you have to save them first, it does however remove my comments from the iptables script. Is this why it was broken?
No. It wasn't starting on boot as you hadn't marked it as a service to be run at boot with "chkconfig iptables on"

Use "chkconfig --list | grep 3:on" to see which services will start at boot (runlevel 3).

Manage the list with "chkconfig serviceName on" or chkconfig serviceName off".
 
Old 08-03-2009, 08:07 AM   #6
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Original Poster
Rep: Reputation: 18
All I did was the /etc/init.d/iptables save I didn't do any of the other chkconfig items as already listed above, its already set to on.

Code:
iptables       	0:off	1:off	2:on	3:on	4:on	5:on	6:off
 
  


Reply



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 01:06 AM
iptables suddenly will not start cylarz Linux - Kernel 2 06-28-2008 11:48 PM
can not start my iptables xudingding Linux - Security 6 10-13-2005 02:30 PM
Start DHCPd and configure iptables on boot (Debian Sarge) Qis Linux - Networking 6 03-02-2005 05:34 AM
IPTABLES nat doesn't start up at boot soldieron Linux - Security 4 09-25-2003 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:55 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
Open Source Consulting | Domain Registration