LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-26-2004, 04:30 AM   #1
netguy2000
Member
 
Registered: Oct 2003
Location: Karachi, PAKISTAN
Distribution: Redhat, Fedora, Open BSD, FreeBSD, SlackWare
Posts: 115

Rep: Reputation: 15
Question IPTABLES firewall Vs rc firewall


Dear all,
I am using IPTABLES firewall (like i setup incomming ports
and Forward ports open / close through IPTABELS commands), I want to
know is IPTABLES firewall better then rc Firewall file. or rc
Firewall is better then IPTABLES ??? plzzz reply me soon and inform
me which is lighter in loading and functionality???

Thanks in advance.
Rizwan.
 
Old 02-26-2004, 06:18 AM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
rc.firewall is just a script that issues the necessary iptables commands to setup your firewall. If you are manually issuing iptables commands I would suggest you look at using or making a script to automate it.

Last edited by /bin/bash; 02-26-2004 at 06:19 AM.
 
Old 02-26-2004, 07:10 AM   #3
netguy2000
Member
 
Registered: Oct 2003
Location: Karachi, PAKISTAN
Distribution: Redhat, Fedora, Open BSD, FreeBSD, SlackWare
Posts: 115

Original Poster
Rep: Reputation: 15
Yes thats i want to know plz tell me is it neccesary to automate IPTABLES commands which I put manualy ??? is script firewall is good or just manually incerted IPTABLES command work fine??? plzzzzzzzzzzzz let me know
 
Old 02-26-2004, 08:35 AM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
It's not a necessity to automate your firewall, but it does make things more convenient. A scripted firewall is only as good as the commands that you put into it. You may want to look at a couple of of the existing iptables scripts rather than writing your own (at least when you are starting out).
 
Old 02-26-2004, 01:09 PM   #5
flashingcurser
Member
 
Registered: Jan 2003
Distribution: many win/nix/mac
Posts: 259

Rep: Reputation: 32
This is one way you can automate your firewall, milage may vary.

1 goto this site: http://easyfwgen.morizot.net/gen/
2. walk through the prompts--when its finished it will give you a very good script. Remember garbage in garbage out.
3. cut and past script into rc.firewall--in the script it will ask you for the location of iptables. Make sure this path is correct--it defaults to /usr/local/sbin which is correct for a redhat based distro. In slack its /usr/sbin
4 reboot or /etc/rc.d/rc.firewall start---I would just reboot and check the messages

Have fun


Last edited by flashingcurser; 02-26-2004 at 01:12 PM.
 
Old 02-27-2004, 03:17 AM   #6
netguy2000
Member
 
Registered: Oct 2003
Location: Karachi, PAKISTAN
Distribution: Redhat, Fedora, Open BSD, FreeBSD, SlackWare
Posts: 115

Original Poster
Rep: Reputation: 15
ok let me agree with you to create script on ur insist, but I not install firewall when i install my GW Redhat machine I select "no firewall" option in it so i have no rc.firewall file plzzz give me instruction how can i ser firewall to run my firewall script???? and also fw intallation will not make any efficet on my existing network GW.

Thanks thanks thanks in advance.
 
Old 02-27-2004, 06:07 AM   #7
slack_baby
LQ Newbie
 
Registered: Feb 2004
Posts: 3

Rep: Reputation: 0
here is the edited script that i run on my box

## rc.firewall edited script

Code:
#!/bin/sh
 # /etc/rc.d/rc.firewall
 
 IPT=/usr/sbin/iptables
 FILE=/etc/iptabrule
 # Reset all previous iptables rules
 firewall_dellall() {
 $IPT -F
 $IPT -t nat -F
 $IPT -t mangle -F
 $IPT --delete-chain
 $IPT -t nat --delete-chain
 echo "All tables, rules are reset"
 }

 firewall_restore() {
 /bin/cat $FILE | /usr/sbin/iptables-restore
 echo "All rules restored from $FILE"
 }
 
 firewall_start() {
 echo "firewall start"
 }
 
 case "$1" in
 'start')
 firewall_start
 ;;
 'dellall')
 firewall_dellall
 ;;
 'restart')
 firewall_restart
 ;;
 'reload')
 firewall_reload
 ;;
 'status')
 firewall_status
 $IPT -nL ;;
 'restore')
 firewall_restore
 ;;
 *)
 echo "usage $0 start|dellall|restart|reload|status|restore"
 esac
edit FILE variable to ur IPTABLES RULES FILE LOCATION

and in rc.local add
/etc/rc.d/rc.firewall restore

Hope this will help u
 
Old 02-28-2004, 04:31 AM   #8
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
You can look at some of the scripts here and see if one would work for you.

I use this firewall script.
 
  


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 with iptables-firewall.conf arno's matt3333 Slackware 16 06-28-2007 07:20 AM
iptables vs. rc.firewall FiveFlat Linux - Security 2 08-13-2004 03:39 PM
rc.firewall vs iptables dunmarie Linux - Security 2 10-09-2003 02:00 PM
firewall iptables SchwipSchwap Linux - Newbie 2 09-14-2002 06:41 AM
Need Help with Firewall, iptables!!!! jamesws Linux - Networking 2 02-11-2002 05:56 PM

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

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