Re: [Hampshire] IP address translation

Top Page

Reply to this message
Author: David Anderson
Date:  
To: hampshire
Subject: Re: [Hampshire] IP address translation
On Mon, 30 Jan 2012 15:49:53 +0000
James Courtier-Dutton <james.dutton@???> wrote:

> Hi,
>
> I understand how to do network address and port translation in Linux
> in a many to one type setup that you might normally get on a ADSL
> line.
>
> What I have not done before is network address translation but
> preserving the port numbers.
> So, if the private side of the box is 192.168.1.0/24
> and the public side of the box should make the private side look like
> 158.153.1.0/24, how is this done in Linux.
> E.g.
> Private PC on 192.168.1.1 sends a packet with source address
> 192.168.1.1, source port 12000, destination port 80.
> Public side sees a session coming from 158.152.1.1 source port 12000,
> destination port 80.
>
> Private PC on 192.168.1.2 sends a packet with source address
> 192.168.1.2, source port 12000, destination port 80.
> Public side sees a session coming from 158.152.1.2 source port 12000,
> destination port 80.
> etc. for each PC on the private network.
>
> As you can see, only the IP address is getting translated. The port
> numbers are preserved.
>
> Has anyone tried this on Linux?
> Does it work?


I used to have a Draytek router which allowed that - so it is possible.
Of course you have to have sufficient ip addresses from your ISP

Regards
David


--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------