LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-21-2003, 03:40 PM   #1
jrgalan
LQ Newbie
 
Registered: Jul 2003
Posts: 11

Rep: Reputation: 0
Where to save Firewall?


after having decided what rules need to be set for iptables, should you save the iptables modifications by typing:

service iptables save.

or, is it better to create a script and what's the difference?

also, where should you save this scipt in Red Hat 9?

thanks!
 
Old 08-21-2003, 04:34 PM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
you can do

iptables-save > /etc/sysconfig/iptables

to save the currently loaded rules which will be loaded everytime you restart
 
Old 08-21-2003, 05:40 PM   #3
jrgalan
LQ Newbie
 
Registered: Jul 2003
Posts: 11

Original Poster
Rep: Reputation: 0
thanks for the reply looking_lost.

iptables-save > /etc/sysconfig/iptables accomplishes the same thing as service iptables save - saving the changes in the iptables file.

i guess my question is what are the advantages of creating a firewall script, and where should you save it?
 
Old 08-21-2003, 05:41 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Only real difference is that by loading the rules by hand from the commandline, you'll see any specific error messgaes. Depending on how you design your script, alot of times the script won't tell you when a rule fails to load (esp if you call the script during the init process). However, I think scripts are easier to work with, so I test out all the rules from the commandline first before I put them in a script. Then at the end of my script I have the same iptables-save > thing that Looking_Lost suggests.

I just put my script in the same directory as the iptables file (/etc/sysconfig/) and make it executable. You can then put the path to the script in one of the /etc/rc.d/ files so that the script is run at boot (it's actually best to use a specfic rc. file, but I don't remember off the top of my head).
HTH
 
Old 08-21-2003, 06:25 PM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
With RedHat and Mandrake, you do not need to create a script in order to apply iptables rules, you can turn ON the iptables service.
The advantage is that the rules will be applied first and then followed by the activation of the network services.

If you want the iptables service to start on system boot,
make sure runlevel 3 and 5 are ON.
Code:
chkconfig --list iptables
To start iptables manually, type:
Code:
service iptables start
 
  


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
BSD Firewall vs Linux Firewall ? rootlinux Linux - Security 5 08-29-2007 07:38 AM
Firewall lets ips which are not in the firewall ... why ? sys7em Linux - Networking 2 06-30-2005 12:50 PM
Firewall with features of a Sidewinder firewall? abcampa Linux - Security 4 04-22-2005 04:24 PM
slackware's /etc/rc.d/rc.firewall equivalent ||| firewall script startup win32sux Debian 1 03-06-2004 09:15 PM
Firewall Builder sample firewall policy file ? (.xml) nuwanguy Linux - Networking 0 09-13-2003 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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