Post Reply  Post Thread 
Turn on masquerading for my firewall (for iptables)
Author Message
Nilesh
Super Moderator
******


Posts: 42
Group: Super Moderators
Joined: Jul 2007
Status: Offline
Reputation: 0
Thank 0
0 was given thank in 0 posts
Post: #1
Turn on masquerading for my firewall (for iptables)

The following will grant masquerading functionality, but will not provide a fully-configured firewall.

In this example, we will use device eth0. The following command will begin the configuration of iptables by setting up post routing with the masquerading target:

Quote:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


Edit the /etc/sysctl.conf file to set-up ipv4 forwarding by changing the line which reads:

Quote:
net.ipv4.ip_forward=0
to the following:
net.ipv4.ip_forward=1


If that line does not exist, simply add the above line which sets the ip_forward value to 1 (one). Then run the following command which will reread your sysctl file:

Quote:
sysctl -p


Additional information on how to use iptables and how to save iptables configuration can be found in other Knowledge base articles. For additional options and usage for the iptables command, see the man page by executing man iptables from the command line.


~~~ Cool Buddy ~~~

ADD TO DEL.ICIO.US  ADD TO DIGG  ADD TO FURL  ADD TO NEWSVINE  ADD TO NETSCAPE 
ADD TO TECHNORATI FAVORITES  Technorati ADD TO SQUIDOO  ADD TO WINDOWS LIVE  ADD TO YAHOO MYWEB  ADD TO ASK 
ADD TO REDDIT  ADD TO STUMBLEUPON  ADD TO GOOGLE   

07-15-2007 09:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Sendmail Domain Masquerading admin 0 317 07-24-2007 06:46 PM
Last Post: admin
  Block Messenger (AOL, Yahoo, MSN) services through Squid and Iptables admin 0 4,422 07-24-2007 06:44 PM
Last Post: admin

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: