Sign in to follow this  

NAT punch through

This topic is 4304 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

okay, im having problems punching through my NAT so people can connect to my game. I connect to the internet via port 80 and send a few request to my master server. A client then comes along gets the servers ip, and attempts to connect but on port 6464, i assume the servers NAT doesnt know how to foward 6464. So what i've tried doing is making the master server connect to my master server on the internet on port 6464, this way the client should then be able to connect through port 6464. Problem is, i cant connect to my internet server on port 6464. Any ideas on what i can do short of getting my provider to open up port 6464 for me?

Share this post


Link to post
Share on other sites
It's un-clear what the problem even is. Are you running a residential gateway or firewall at home? If so, you need to set the actual server machine into a DMZ, or you need to port forward 6464 to your server through the firewall.

Share this post


Link to post
Share on other sites
computer A is behind a fire wall, and is hosting my game server. computer A registeres it self with a master server on the internet, but via port 80.

My game uses port 6464 to connect.

Now a computer B comes along, gets a list of ip's from the master server, then attempts to connect to one. The ip is computer A's internet address, so attempts to connect on port 6464.

The connection fails, and my guess is that because my server has not punched through the nat on port 6464, the router/dsl modem/nat wont know how to foward packets comming in on that port.

So, i'm thinking i need to punch a connection through on port 6464 to some server on the internet so the NAT knows how to foward the packets. Problem is you cant open up an connection on a random port (6464) to my webserver.

So i'm wondering what the solution is, with out the user going to configure thier routers to foward that port to thier PC....

Share this post


Link to post
Share on other sites
Quote:
Original post by supagu
So, i'm thinking i need to punch a connection through on port 6464 to some server on the internet so the NAT knows how to foward the packets. Problem is you cant open up an connection on a random port (6464) to my webserver.

Well, first, I'm assuming this is UDP. Punching through NAT is most easily accomplished with it, as far as I understand.

The problem with your approach is that after connecting to the Internet server on port 6464 the NAT is only going to forward packets originating from the internet server on that port. That's why a client is not going to be able to do anything with this approach.

So what you actually need is to try sending a packet to the client from your NATed server, so that the NAT knows to forward packets from that client to your server. Of course, you may run into an issue where the client is also behind a NAT, in which case it also has to send a packet out to your server to punch through it's NAT. This is going to require both the server and client being connected to the internet server to coordinate the punching through process.

I've been reading on this recently, so its possible of got something wrong. But as far as I can tell this is how it is done.

Share this post


Link to post
Share on other sites
I don't think you understand the requirements for punch-through. For punch-through to work, you have to register on the same port as you will be using, and you have to have an actively participating matchmaker server. The Forum FAQ has several links to NAT punch-through documents. Also, if you're trying to do this with TCP, you should know that TCP punch-through support is quite spotty. UDP punch-through support is much more widespread.

Share this post


Link to post
Share on other sites

This topic is 4304 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this