From: "Nikolai Dahlem" Subject: NAT changing src-port Date: Mon, 1 Mar 2004 13:16:36 +0100 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01C3FF8F.6CBDCC50" Return-path: To: Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: netfilter-devel.vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C3FF8F.6CBDCC50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, I'm working on a pair of connection tracking / nat helper modules; when NAT sees the first outgoing packet of the connection it changes the src port to some free port (1024 in the example), but the remote side is responding to the port listed in the packet payload (5022), thus the answer to the request is not recognized. How can I get the port the new (changed) port from netfilter, to change the payload accordingly in my NAT-helper ? udp 17 25 src=172.30.8.100 dst=10.20.10.198 sport=5022 dport=5014 [UNREPLIED] src=10.20.10.198 dst=10.20.10.213 sport=5014 dport=1024 use=3 udp 17 25 src=10.20.10.198 dst=10.20.10.213 sport=5014 dport=5022 [UNREPLIED] src=10.20.10.213 dst=10.20.10.198 sport=5022 dport=5014 use=1 And is there a way to tie the timeouts of related connections together ? My related connections are UDP and one rarely sees data while there is a constant flow of data on the other related connection, it's undesired that one related connection gets a timeout, while the other one is still active. regards Nikolai Dahlem ------=_NextPart_000_0006_01C3FF8F.6CBDCC50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I'm = working on a=20 pair of connection tracking / nat helper modules; when NAT sees the = first=20 outgoing packet of the connection it changes the src port to some free = port=20 (1024 in the example), but the remote side is responding to the = port listed=20 in the packet payload (5022), thus the answer to the request is not = recognized.=20 How can I get the port the new (changed) port from netfilter, to change = the=20 payload accordingly in my NAT-helper ?
 
udp      17 25 = src=3D172.30.8.100 dst=3D10.20.10.198 sport=3D5022 dport=3D5014=20 [UNREPLIED] src=3D10.20.10.198 dst=3D10.20.10.213 sport=3D5014 = dport=3D1024 use=3D3
udp      17 25 = src=3D10.20.10.198 dst=3D10.20.10.213 sport=3D5014 dport=3D5022 = [UNREPLIED] src=3D10.20.10.213 dst=3D10.20.10.198 = sport=3D5022=20 dport=3D5014 = use=3D1
And is there a=20 way to tie the timeouts of related connections together ? My related = connections=20 are UDP and one rarely sees data while there is a constant = flow of=20 data on the other related connection, it's undesired that one = related=20 connection gets a timeout, while the other one is still=20 active. 
 
 
regards
 
Nikolai=20 Dahlem
------=_NextPart_000_0006_01C3FF8F.6CBDCC50--