FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-24-2009, 07:34 PM
abdelkader belahcene
 
Default how to store iptables rules

hi,
please i want to save the iptables for next sessions,
now I have to run iptables* after each reboot.
I tried iptables-save, it did't.
thanks for help
bela
 
Old 01-24-2009, 09:35 PM
L Glidewell
 
Default how to store iptables rules

On Saturday 24 January 2009 12:34:52 abdelkader belahcene wrote:
> hi,
> please i want to save the iptables for next sessions,
> now I have to run iptables after each reboot.
> I tried iptables-save, it did't.
> thanks for help
> bela

Redirect it to a file:
iptables-save > target-file

You will also need to set it up to restore the rules from the file during
bootup. This is done, iirc, by running
iptables-restore < target-file
That can be done in /etc/network/interfaces, but there is a particular syntax
which escapes me at the moment.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-25-2009, 07:23 AM
"Boyd Stephen Smith Jr."
 
Default how to store iptables rules

On Saturday 24 January 2009, abdelkader belahcene <abelahcene@gmail.com>
wrote about 'how to store iptables rules':
>please i want to save the iptables for next sessions,
>now I have to run iptables after each reboot.
>I tried iptables-save, it did't.

Search the archive, there was a discussion about this within the last
month. I believe the subject mentioned an init script which does exist
anymore, but there were a number of solutions to your problem posted.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
 
Old 01-25-2009, 11:00 AM
Paul Cartwright
 
Default how to store iptables rules

On Sat January 24 2009, abdelkader belahcene wrote:
> hi,
> please i want to save the iptables for next sessions,
> now I have to run iptables* after each reboot.
> I tried iptables-save, it did't.
> thanks for help
> bela

we just had this discussion. Look for the subject: iptables/firestarter
here is what I took to be the ANSWER:
http://www.debian-administration.org/articles/615 has more information
about this topic.

Personally, I do this:

Ensure that you have your firewall rules set up as you wish them.
Then, edit /etc/network/interfaces to add the following:

# Bring up firewall
pre-up iptables-restore < /etc/iptables.rules

# And save fw state on shutdown
post-down iptables-save -c > /etc/iptables.rules


However, people seem to be saying that this may have drawbacks, as if
you add a bad rule or otherwise negatively alter your ruleset, it
would get automatically saved. *Since I make all edits to my iptables
rules in a shell script that I source when I want to change them, I'm
not too worried about that, but you can see several alternate
solutions from the link above.

Hope this helps!


--
Paul Cartwright
Registered Linux user # 367800
Registered Ubuntu User #12459


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 04:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org