a problem about NAT.
hi, all
There are 3 machine behind the NAT server. When the 3 machine request the same Web server outside, NAT use 3 different source port to distinguish the 3 connection. My problem is when the 3 machine have the same source port , how netfilter handle it ? I also want to know where the handle code is . Thanks . --
Quoted 7 lines · Chen Jian
There are 3 machine behind the NAT server. When the 3 machine request the same Web server outside, NAT use 3 different source port to distinguish the 3 connection.
My problem is when the 3 machine have the same source port , how netfilter handle it ? I also want to know where the handle code is . Thanks .
I can't help with the source code reference, but I can answer the first question. The three machines necessarily have different IP addresses. Connections are identified by (IP address, port), so even if they happen to all pick the same port, they are still uniquely identified.
Similarly for returning packets after NAT: conntrack uses the same IP address but different ports for each connection, so it can identify which connection the replies belong to, and rewrite the destination IP and port correctly.
James F. Carter Voice 310 825 2897 FAX 310 206 6673
UCLA-Mathnet; 6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA 90095-1555
Email: [email protected] http://www.math.ucla.edu/~jimc (q.v. for PGP key)