Re: [Hampshire] IP address translation

Top Page

Reply to this message
Author: Ian Grody
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] IP address translation
The feature you are looking for is static port mapping. Ive never used linux box for natting so anyone who knows iptables will help.


Sent from an HTC Mobile. Expect worse typos and grammar

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?
>
>Kind regards
>
>James
>
>--
>Please post to: Hampshire@???
>Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
>LUG URL: http://www.hantslug.org.uk
>--------------------------------------------------------------

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