LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2007, 12:25 AM   #1
canuck_dude
LQ Newbie
 
Registered: Jan 2007
Distribution: Fedora Core 6
Posts: 8

Rep: Reputation: 0
Firewall Start at Boot


Hey,

I made a firewall using iptables and have it in a shell script. How do I make the script execute at boot time so it gets automatically setup? I tried putting it in the /etc/rc.d/rc.local file but it always crashes my computer when I restart. I'm using Fedora Core 6.
 
Old 02-01-2007, 01:04 AM   #2
wildar
Member
 
Registered: Jan 2007
Distribution: Mandriva 2008, Mandrake 2005, Ubuntu 8.04.1
Posts: 239

Rep: Reputation: 30
First you should test the script before including it any start up scripts. Use your favorite text editor, enter the stuff, save and exit. From a shell make it executable using chmod, example
Code:
chmod 744 testscript
Then run the script and see what happens.

Might help if you posted the script in code box for us to review.
 
Old 02-01-2007, 01:24 AM   #3
canuck_dude
LQ Newbie
 
Registered: Jan 2007
Distribution: Fedora Core 6
Posts: 8

Original Poster
Rep: Reputation: 0
I've already tested script and there's nothing wrong with it.
 
Old 02-01-2007, 01:30 AM   #4
wildar
Member
 
Registered: Jan 2007
Distribution: Mandriva 2008, Mandrake 2005, Ubuntu 8.04.1
Posts: 239

Rep: Reputation: 30
Ok then, lets have a look at the rc.local with your script included.
 
Old 02-01-2007, 01:38 AM   #5
canuck_dude
LQ Newbie
 
Registered: Jan 2007
Distribution: Fedora Core 6
Posts: 8

Original Poster
Rep: Reputation: 0
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
#

touch /var/lock/subsys/local

. /etc/rc.d/rc.firewall
 
Old 02-01-2007, 01:59 AM   #6
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Rep: Reputation: 38
Not sure why it would "crash" your system, but you don't need the (dot space) at the front of the line when you're running it from rc.local.

Cheers.
 
  


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
SuSE 9.3 firewall won't start Tofo SUSE / openSUSE 4 07-04-2005 08:56 PM
rc.firewall fails to start hubabuba Slackware 3 04-05-2005 05:17 AM
stop/start firewall matt1982 Debian 6 11-12-2004 07:17 AM
how to start firewall automatically shanenin Linux - Software 10 10-26-2003 03:04 PM
Linux Firewall - Where do I start? yorkshiresteve Linux - Security 9 07-10-2003 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:03 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