LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-30-2011, 06:46 AM   #1
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,063

Rep: Reputation: 47
getting iptables to run on boot


I don't like this: http://www.debian-administration.org/articles/445
because every time there is slight change in firewall rules, all that would have to be done again and again.

is there a simpler way?
 
Old 05-30-2011, 02:47 PM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by qrange View Post
Well, that's entirely up to you of course...

Quote:
Originally Posted by qrange View Post
because every time there is slight change in firewall rules, all that would have to be done again and again.
Well, that's not really true...you could edit your ruleset and save it, to your rule-save-location. That's easy, it works.

But it isn't the only way to do things by any means.

Quote:
Originally Posted by qrange View Post
is there a simpler way?
Oh, yes. But first, you don't want the advantage of the way that you don't like, do you? That is, about the only sensible (?) way of getting the packet counters to survive across reboots is to use the iptables-save and iptables-restore route, so if you want that 'feature', than you might want to reconsider how much you don't like it.

So, then you have the option of using one of the graphical front-ends to generate a ruleset. Now I never managed to find one that I really liked, but YMMV.

Alternatively (and I think that this is the best solution), run a script on start up that generates your ruleset. this implies that you can write a bash script (other shells are available) that generates a set of rules that gives you the firewall that you want.
 
1 members found this post helpful.
Old 05-31-2011, 01:28 AM   #3
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,063

Original Poster
Rep: Reputation: 47
I don't know what 'packet counters' are, but ok.
I had put the script that starts iptables (output from 'Firewall Builder') into startup, will do it your way if it so much better.
 
Old 05-31-2011, 06:44 AM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by qrange View Post
I don't know what 'packet counters' are, but ok.
Ahhh, something I can explain.

Packet counters are counters that count packets. You can count the packets that are processed by each chain, and maintain a count that just goes up and up as traffic passes. Most people don't use them, but they can be quite handy in certain circumstances. What would be more difficult would be if you have a box that does get re-booted every so often (in the way that most servers don't, except by accident), and need the counts of packets to carry on accumulating after the re-boot.

It sounds as if you don't need that, but, if you did, you would have to look at iptables-save and iptables-restore for the appropriate options. Documented in the man pages.

Quote:
Originally Posted by qrange View Post
I had put the script that starts iptables (output from 'Firewall Builder') into startup, will do it your way if it so much better.
Better? Worse? More a case of 'appropriate' or 'inappropriate'. Getting a bash shell script to generate your ruleset for you is flexible and relatively easy and, with thought, the issue of minor changes (for example, if you have to change subnet addresses) can be almost trivial. See examples:
http://www.yolinux.com/TUTORIALS/Lin...rkGateway.html
http://www.linuxhomenetworking.com/w...Using_iptables

and, if you wanted closer to a manual:
http://iptables-tutorial.frozentux.net/

if you google (other search engines are available) on 'iptables' and 'tutorial', you will find more information than you can read.
 
1 members found this post helpful.
  


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
I run Fedora 9 and I boot from USB, how I run at startup Firewall and antivirus? gginis Linux - Software 3 06-08-2008 03:19 AM
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 08:15 PM
Priority: script to run on boot vs. "service iptables save" iheardrain Linux - General 5 09-30-2004 09:53 PM
iptables to run at boot LUXX Arch 5 11-07-2003 10:48 PM
RH8 - how to automatically run iptables rules shell script at boot time nu-B Linux - General 1 10-29-2003 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:44 PM.

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