How do I connect to an open tcp port on a client machine from an unknown server?

I've read a lot about different NAT traversal methods, but I'm still a bit confused about how it works.

If I open a TCP port on the client machine and send a request to some arbitrary non-existent server (which won't respond), my NAT client will now have an open channel, right? Can I use another (unknown) computer with a different IP address to access this client port if I know both the client's public and private IP addresses and the port number?

Or will my NAT check where my server packet is coming from and block it since it is not from the same IP as the original request from the client machine?

Thanks in advance!

+3


source to share


1 answer


To answer your question, you need to know a little about NAT and filtering settings. First let me provide some information on the behavior of the NAT binding,

If you send a packet from your internal IP port through your NAT IP port to any address, your NAT creates a MAP between your internal and IP port. Other sane no one outside your NAT can send you anything.

There are 4 types of NAT,

Full-cone NAT: If you previously sent a packet from your internal IP port through your NAT IP port, then any external host can send the packet to your internal IP port by sending the packet to your IP IP port.

Bounded Cone NAT Address: An external host can send packets to your internal IP port by sending packets to your NAT IP port only if there was at least a packet from your internal IP port that was previously sent to that external IP host through your NAT IP port: This external host port is irrelevant here. Only the IP address must be the same.



NAT Cone Restricted Port: Same as address restricted this time only. At least a packet previously sent from your internal IP: port to that external IP: port through your IP: port will allow this external host to send you packets from its IP port through your NAT, which has an IP port ...

Symmetrical the NAT: . Its juxtaposition behavior is slightly different from others. For the previous 3 types of NAT, from your internal IP port, no matter where you send your data, it will traverse the NAT, the same IP: Port. But for symmetric NAT for a different destination, your data will traverse NAT, but the same IP address, but a different port. And as a cone bounded port, an incoming packet will be allowed through NAT if data previously sent to that external IP port is :.

So, for your scenario, only if your NAT is Full cone NAT than any unknown person who knows your NAT, that the public IP port from which you sent the packet to the unknown server can send data to you via UDP transport. For other NAT, it will be blocked since you did not send data to this external host. But for your TCP connection, no one can send you any data, even if they know your private and public IP port: they are behind different NATs. Read more in the form.

More on the wiki .

+4


source







All Articles