Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 11-24-2003, 07:46 AM   #1
LQ Newbie
Registered: Nov 2003
Posts: 2

Rep: Reputation: 0
Angry iptables works fine but not after boot

I've got iptables working absolutely fine on my machine (Redhat 8) but when I reboot my machine, all ports are closed. If I log in as root using the keyboard and just do service iptables restart, everything starts working again.

I'm wondering if anyone has experienced this. My network card is a bit non-standard and I needed to use a custom driver for it so, noticing that iptables was started up before the network card was, I renamed the S---- file in rc3.d so that it was numerically higher than the network. I actually renamed it S98iptables so it's one of the last things to get started. Still didn't work.

So then I edited /etc/rc.d/rc and, at the very end of the file, put service iptables restart. Still no luck.

When I examine boot.log, I can see that the iptables service is being started up at the very end and yet it still doesn't work. Only by logging in as root through the keyboard and restarting the service can I get it to work.

I'm not using DHCP and my machine has a static address on my local 192.168 subnet.
Old 11-24-2003, 09:04 AM   #2
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
Looks like you may have a problem with the init scripts. Try using chkconfig to configure iptables to start in runlevels 2,3,4 and 5:

chkconfig iptables on

Then you might want to use rpm to verify the integrity of the iptables package files:

rpm -Vf iptables

You can verify the integrity of the the initscripts package files with:

rpm -Vf initscripts

If you notice that some of the /etc/rc.d/rc* scripts have been changed then you can grab a fresh copy from the rpm using mc (Midnight Commander - it can browse through rpms).
Old 11-24-2003, 10:51 AM   #3
LQ Newbie
Registered: Nov 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks Hazza,

in the end, the whole thing turned out to be something else completely.

My fstab file specified a samba share on another machine that was no longer present. Little did I realise it but as my machine was booting up, it was halting when fstab tried to mount this directory and wouldn't resume booting until a key had been pressed.

Rather than lug my 19" monitor over to the server, I was just plugging in a keyboard and typing blind to login and restart the iptables service. What was happening, though I couldn't see it, was that my keypresses for logging in caused the boot process to resume. The keypresses were buffered up so when the boot process finished, it then whizzed through the login. It wasn't the logging in and restarting iptables that was making it work, simply the fact that it had finished booting.

Anyway, all's well that ends well. A cautionary tale for anyone who doesn't have a monitor plugged into their server.


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
X won't start at boot, startx works fine though TLV Debian 15 01-03-2007 09:10 AM
Boot from hard drive stalls, rescue CD works fine jonr Mandriva 12 11-09-2004 07:54 PM
e0 will Rx, but not Tx...e1 works fine giant Linux - Networking 2 09-15-2004 02:13 PM
Fedora freeze on initial boot, but works fine on reboot. petterdk Linux - Laptop and Netbook 0 04-19-2004 10:23 AM
Works just fine...I think /home/kyle Linux - Software 0 03-10-2004 06:09 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:43 AM.

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