LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2008, 09:52 AM   #1
ochienged
Member
 
Registered: Oct 2007
Location: Plano, TX
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 70

Rep: Reputation: 26
Save iptables rules


I set iptable rules but i cant remember the command for saving them. Someone remind me please. Regards
 
Old 04-15-2008, 10:02 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by ochienged View Post
I set iptable rules but i cant remember the command for saving them. Someone remind me please. Regards
The generic way:
Code:
iptables-save > /somewhere/example.txt
As you can see, you can save the config to any text file you want, but you should probably find-out which file your distro is configured to automatically restore them from at boot time and then save to that. Usually it's something like /etc/sysconfig/iptables or similar.

The Red Hat-based distro way:
Code:
service iptables save
 
Old 04-15-2008, 10:07 AM   #3
Curtix
LQ Newbie
 
Registered: Apr 2008
Posts: 13

Rep: Reputation: 0
iptables-restore as well is the counter
Code:
iptables-restore /somewhere/whateveryousavedas
saved my butt 10 min ago.
 
  


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-save, iptables-restore, how to set up them in some script sarajevo Linux - Networking 1 03-24-2008 11:39 PM
iptables 1.27a still loading rules after installing iptables 1.3.0 yawe_frek Linux - Software 1 06-07-2007 09:50 PM
how to save iptables firewall rules permanently sunlinux Linux - Security 3 12-07-2006 11:53 AM
iptables-save, but rules don't load on boot-up kpachopoulos Debian 2 11-18-2006 10:36 PM
iptables save rules Osten Debian 1 02-10-2004 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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