Port Forwarding Question
by Weston Elliott · in Torque Game Engine · 07/15/2008 (5:28 pm) · 21 replies
Well I was using the standard 28000 and 28002 ports in the FPS Starter Kit and was testing it with two other people. one person wasn't able to do anything without port forwarding, the other could connect fine immediately without port forwarding. So then I changed my ports to 6666 and 6667. That gave it the opposite effect. Now the person who originally had to port forward did not need to for the new ports, and the person who connected fine now needed to setup port forwarding for the new ports.
My question is, is there some way around port forwarding? It appears as though certain ports are unblocked on some routers already. Is there some unblocked port I could use?
My question is, is there some way around port forwarding? It appears as though certain ports are unblocked on some routers already. Is there some unblocked port I could use?
#2
07/16/2008 (10:36 am)
Ah, so those who want to host a game need to setup port forwarding, and those not hosting a game don't have to worry about it then?
#3
There are ways around it, like VPN clients. If you and your friends don't want to risk having permanent paths setup on your routers that point all traffic incomming to 28000 & 28002 to your home machines, get the free version of Hamachi https://secure.logmein.com/products/hamachi/vpn.asp
It will create a secure virtual network between your 3 computers when you join them in a network group. No one can jump into your network, and your computers will see each other as being right next to each other, no matter what the distance. Bypassing NAT servers.
When one of you hosts a game the other two just have to tell the game client your hamachi IP.
07/16/2008 (11:15 am)
Yup.There are ways around it, like VPN clients. If you and your friends don't want to risk having permanent paths setup on your routers that point all traffic incomming to 28000 & 28002 to your home machines, get the free version of Hamachi https://secure.logmein.com/products/hamachi/vpn.asp
It will create a secure virtual network between your 3 computers when you join them in a network group. No one can jump into your network, and your computers will see each other as being right next to each other, no matter what the distance. Bypassing NAT servers.
When one of you hosts a game the other two just have to tell the game client your hamachi IP.
#4
I am still having issues connecting though. I have setup a master server in my basement and setup port forwarding in my router for the ports I am using. I am also hosting a game off the same machine and the master server gets the connection from the game server. I am able to connect fine from other machines within my network, but anybody outside of my network is able to find the server game server. It queries my IP - then the router redirects the information for the ports to the master server just fine, but then it times out. What could I be doing wrong? It appears the master server is found fine, but not the game server.
07/16/2008 (12:06 pm)
Okay.I am still having issues connecting though. I have setup a master server in my basement and setup port forwarding in my router for the ports I am using. I am also hosting a game off the same machine and the master server gets the connection from the game server. I am able to connect fine from other machines within my network, but anybody outside of my network is able to find the server game server. It queries my IP - then the router redirects the information for the ports to the master server just fine, but then it times out. What could I be doing wrong? It appears the master server is found fine, but not the game server.
#5
You've got the masterserver ports forwarded correctly, but it seems like the game server ports aren't.
07/16/2008 (12:23 pm)
All ports are forwarded?You've got the masterserver ports forwarded correctly, but it seems like the game server ports aren't.
#6
6666
6667
1031
1048
Am I forgetting any? What else could it be?
07/16/2008 (6:59 pm)
Well I switched 28000 with 6666 and 28002 with 6667 for my project. I have the following ports forwarded both UDP and TCP...6666
6667
1031
1048
Am I forgetting any? What else could it be?
#7
Another thing you can do is grab the program Wireshark, formerly known as Ethereal. It's a network analysis tool that can capture every packet traversing your network. You can use it to verify which port the computers on your network are connecting to the game server over.
It's a pretty straightforward program, but to be useful it captures a lot of info.
07/16/2008 (9:46 pm)
Try opening 28000 and 28002 as well, you might have accidentally changed it back, or the change never really took hold.Another thing you can do is grab the program Wireshark, formerly known as Ethereal. It's a network analysis tool that can capture every packet traversing your network. You can use it to verify which port the computers on your network are connecting to the game server over.
It's a pretty straightforward program, but to be useful it captures a lot of info.
#8
UDP Source port: 6668 Destination port: 62468
UDP Source port: 62468 Destination port: 6668
This is what I get when I host a game...
UDP Source port: 6666 Destination port: 6667
I never set my project to use the ports 6668 and 62468 though. So why would it be? Does this mean I need to setup port forwarding for these two ports too? Also, I setup port forwarding for ports 28000 and 28002 but that didn't help much.
07/16/2008 (11:22 pm)
Okay I downloaded Wireshark and used it to see what ports were being used. This is what I get when I query for a game...UDP Source port: 6668 Destination port: 62468
UDP Source port: 62468 Destination port: 6668
This is what I get when I host a game...
UDP Source port: 6666 Destination port: 6667
I never set my project to use the ports 6668 and 62468 though. So why would it be? Does this mean I need to setup port forwarding for these two ports too? Also, I setup port forwarding for ports 28000 and 28002 but that didn't help much.
#9
I'm guessing 62468 was was used by the master server and 6668 by the client? It would probably be a good idea to open these as well, and strip out the 28000 and 280002 entries.
Also, do a search through your scripts and code for those port numbers, see if you can track down where they are being defined.
07/17/2008 (7:27 am)
First make sure 6666 and 6667 are setup for UDP forwarding, not just TCP.I'm guessing 62468 was was used by the master server and 6668 by the client? It would probably be a good idea to open these as well, and strip out the 28000 and 280002 entries.
Also, do a search through your scripts and code for those port numbers, see if you can track down where they are being defined.
#10
55556
53084
53085
55998
55999
Actually, all the ports listed above were recorded off the same computer. It seems to change every time I restart the game. I am pretty confused as to what is going on...
07/17/2008 (10:40 am)
Yeah I got the ports 6666 and 6667 both setup on UDP and TCP. Also, I ran my project with Wireshark on different computers and on different networks and the 62468 seems to change a lot, but 6668 remains the same. So I have also setup port 6668 on UDP and TCP. Why does 62468 keep changing around so much? Here are a few other port numbers I have gotten instead of 62468...55556
53084
53085
55998
55999
Actually, all the ports listed above were recorded off the same computer. It seems to change every time I restart the game. I am pretty confused as to what is going on...
#11
I'm going to assume those ports are associated with the client computers connecting to the game, which is normal. A static port assignment is only needed for the game server itself, so the clients know where to send the request. Clients can have random ports because when it connects to the game, it tells the server which port the client is expecting the return packets to go to.
07/17/2008 (11:06 am)
Is it happening when you're querying the master server, or connecting to the game itself?I'm going to assume those ports are associated with the client computers connecting to the game, which is normal. A static port assignment is only needed for the game server itself, so the clients know where to send the request. Clients can have random ports because when it connects to the game, it tells the server which port the client is expecting the return packets to go to.
#12
I am hosting a game server on the same machine that is running the master server script. When I am on my own network and I query for a game I can find it completely fine. When I am on a separate network I am not able to see the game. I had a friend setup the same ports on his network and start a game server. I am able to see and join his game server just fine, but he is still unable to see mine. Could the one I am hosting be set to LAN somehow? How would I check that and make it visible to the world?
07/17/2008 (3:53 pm)
The one port changes when I query for a game. Also, people on different networks still aren't able to find games. I have 1031, 1048, 6666, 6667, 6668, 28000, and 28002 all setup with TCP and UDP port forwarding. Yet I am only able to find a game when I query within my network.I am hosting a game server on the same machine that is running the master server script. When I am on my own network and I query for a game I can find it completely fine. When I am on a separate network I am not able to see the game. I had a friend setup the same ports on his network and start a game server. I am able to see and join his game server just fine, but he is still unable to see mine. Could the one I am hosting be set to LAN somehow? How would I check that and make it visible to the world?
#13
Just to make sure, have you tried having a friend connect to your game server without going through the master server? Just enter in your public IP and the correct port?
If no then there's your answer, your game server is registering itself with your master server with the only IP address it knows, that machine's private IP.
Your master server, just passing along when it's told to, is giving out an IP that can't possibly track back to your network.
You'll either have to fudge the masterserver listing, or just have your friends connect directly to the game server. Unless you can host the masterserver on a completely separate network.
07/17/2008 (7:09 pm)
Oh I'm a complete idiot...Just to make sure, have you tried having a friend connect to your game server without going through the master server? Just enter in your public IP and the correct port?
If no then there's your answer, your game server is registering itself with your master server with the only IP address it knows, that machine's private IP.
Your master server, just passing along when it's told to, is giving out an IP that can't possibly track back to your network.
You'll either have to fudge the masterserver listing, or just have your friends connect directly to the game server. Unless you can host the masterserver on a completely separate network.
#14
07/17/2008 (7:14 pm)
So a game server can't be hosted on the same computer as the master server? Or do you mean the game server has to be hosted on a separate network entirely?
#15
07/17/2008 (7:21 pm)
Separate network, though there should be some way to have the game server report a different IP.
#16
So does anybody know where I might find a good and cheap server to host the game server on? Or might there be a better way? Like getting the game server to report a different IP. If so, how would I get it to do that?
07/18/2008 (1:21 am)
Yeah that was a stupid question. I get what you were saying now. The game server is registering on the master server with the IP address of the specific computer within the network and the master server is sending that IP address to those trying to find a game, but the IP address can not be recognized outside of my network. I get it now. So does anybody know where I might find a good and cheap server to host the game server on? Or might there be a better way? Like getting the game server to report a different IP. If so, how would I get it to do that?
#17
That should bounce the communications through your router's NAT layer, translating your private IP into your public one, and sending those packets back towards your master server.
07/18/2008 (8:40 am)
Actually I had an idea. Tell the game server that the master server's IP is your public IP.That should bounce the communications through your router's NAT layer, translating your private IP into your public one, and sending those packets back towards your master server.
#18
07/18/2008 (10:28 am)
Actually that is how I have had it setup. I changed it to my public IP yesterday. I have actually gotten much farther now. When somebody queries for a game the master server successfully receives the information and says it sends the information for my game server back to the client, but the person looking for a game still doesn't get the information. If what your saying is right, it should work. I don't understand why it isn't.
#19
Or it could be your game server is telling your masterserver it's own IP in the setup packet, instead of letting the master server figure it out from the return IP.
Try having a friend host a game that gets registered with the master server you have hosted, see if that works properly. If it still doesn't work, even with port forwards setup properly both on your router and his, then the problem isn't with your router and network.
07/18/2008 (11:18 am)
Routers don't all implement things the same, there's a good chance it's doing something that's making this little hack not work properly.Or it could be your game server is telling your masterserver it's own IP in the setup packet, instead of letting the master server figure it out from the return IP.
Try having a friend host a game that gets registered with the master server you have hosted, see if that works properly. If it still doesn't work, even with port forwards setup properly both on your router and his, then the problem isn't with your router and network.
#20
Like this:
Modem
|
Switch - Master Server
|
Router - Other Network Computers
Would that work?
07/18/2008 (7:37 pm)
Okay, I had my friend setup port forwarding and host a game off his network. I was able to find and join his game just fine. So I think it is my router blocking something. If I bought a simple network switch and connected it between my modem and router, then connected my master server to the switch instead of the router would that work?Like this:
Modem
|
Switch - Master Server
|
Router - Other Network Computers
Would that work?
Torque 3D Owner Andrew Wiblemo
Clients connecting to a server should not need port forwarding setup, as they initiate the connection.
The host server will need proper port forwarding, if behind a NAT router.
If I'm getting you right and you hosted the game while 2 others connected, then it sounds to me like person A's connection has issues with high numbered ports, while person B has problems with lower ones. Try a couple more ports, like 65000, 1025, 12345, ect... Have both remove any port forwarding they have setup for this, and be sure to check atleast a couple above the 50000 mark
It's entirely possible their ISPs are blocking certain port ranges in an attempt to stop P2P programs.