<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.12.3">
</HEAD>
<BODY>
On Wed, 2007-04-25 at 12:05 -0400, tleslie wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Wed, 2007-04-25 at 18:40 +0300, Kihara Muriithi wrote:</FONT>
<FONT COLOR="#000000">> /sbin/iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 192.168.2.1</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> when I check the firewall status, I notice this table insertion</FONT>
<FONT COLOR="#000000">> Chain POSTROUTING (policy ACCEPT)</FONT>
<FONT COLOR="#000000">> target     prot opt source               destination         </FONT>
<FONT COLOR="#000000">> SNAT       all  --  0.0.0.0/0            0.0.0.0/0</FONT>
<FONT COLOR="#000000">> to:192.168.2.1</FONT>
<FONT COLOR="#000000">> </FONT>

<FONT COLOR="#000000">SNAT means  source address translation, you want DNAT</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
You also need to a forwards in place too:<BR>
<BR>
# Allow outgoing requests<BR>
iptables -A FORWARD --out-interface eth0 --jump ACCEPT<BR>
# Allow responses back in<BR>
iptables -A FORWARD --in-interface eth0 --match state --state related,established --jump ACCEPT
</BODY>
</HTML>