From: Rusty Russell Subject: Re: NAT through Dom0 on unstable branch Date: Wed, 22 Jun 2005 09:21:01 +1000 Message-ID: <1119396061.19177.10.camel@localhost.localdomain> References: <20050621191513.GA5877@neteligent.de> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20050621191513.GA5877@neteligent.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Toens Bueker Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Tue, 2005-06-21 at 21:15 +0200, Toens Bueker wrote: > Eitan Isaacson wrote: > > sysctl -w net.ipv4.ip_forward=1 # (if not allready done by xend) > > iptables -t nat -A POSTROUTING -j MASQUERADE \ > > -o eth0 -s 192.168.0.1/24 > > An alternative solution would be: > > iptables -t nat -F POSTROUTING > iptables -t nat -F PREROUTING > iptables -t nat -A POSTROUTING -o eth0 -s 192.168.2.0/24 -j SNAT \ > --to-source Yes. Unless the IP address of eth0 is dynamic, the latter form is preferable. Cheers, Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman