Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-04-2007, 07:01 PM   #1
Registered: Dec 2007
Posts: 48

Rep: Reputation: 16
How to save IPtbales in linux box

i always hit the command iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE every morning is there any way to save this so there's no need to hit everytime i restarted the linux box??
Old 12-04-2007, 07:21 PM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
The generic method is to put your commands in a bash script ( say) like this:

#! /bin/bash
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
make it executable: chmod +x
then add it, with it's whole path if needed, to /etc/rc.local

Many distros have other ways of adding the entries.
Old 12-04-2007, 07:52 PM   #3
Registered: Feb 2006
Location: Australia
Distribution: Linux... :-)
Posts: 241
Blog Entries: 1

Rep: Reputation: 50

try this site, it may help(even tho its for ubuntu)....


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
how do you save back ground for fedora core 7 flux box gundumfx Linux - Desktop 6 09-26-2007 03:09 PM
How to copy/save a file from a Linux box to a local drive exl75 Linux - General 11 04-10-2007 12:52 PM
Accessing WevDav directory on linux box A from linux box B using Ant script. panayoti Linux - Newbie 0 10-07-2006 11:44 PM
Reverting GTK2 open/save dialog box to old (GTK1) style wirawan0 Linux - Software 1 02-23-2006 01:44 PM
Can my DNS box serve my site through cash to save bandwidth? 360 Linux - Networking 1 06-04-2002 10:58 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration