[nylug-talk] dumb iptables question...how to translate from one IP to another?

Alex Pilosov alex at pilosoft.com
Fri Jan 4 13:26:23 EST 2008


On Thu, 3 Jan 2008, Henning Follmann wrote:

> On Thu, Jan 03, 2008 at 06:53:47PM -0500, C Thala wrote:
> > I have two boxes set up, gw, and local.
> > 
> > On gw, I have a public IP setup. I want all connections on this public
> > IP to be translated to the local box on its local IP.
> > 
> > 
> > So if the public ip is 64.233.1.4 and the private IP is 192.168.1.1
> > 
> > I want a connection to 64.233.1.4 port 75 to go to 192.68.1.1 port 75.
> > 
> > I think I want NAT here, but I am not sure. I basically want something
> > like pound or haproxy.
> > 
> > Suggestions?
> 
> I think what you are looking for is "proxy arp". google for it.
The smartass comments to "google for it" are only useful if you give the 
correct thing to google for.

What you want is a DNAT.

iptables -t nat -A PREROUTING -p tcp -d 64.233.1.4 --dport 75 -j DNAT 
--to-destination 192.68.1.1:75

-alex



More information about the nylug-talk mailing list