Advertisement

Making a Connection Through A Router

Started by March 15, 2006 08:16 PM
3 comments, last by Sir Sapo 18 years, 11 months ago
Hey everyone, I have a networked game that I've been working one for a little while now, playing it over a LAN at my school, but now I would like to test it over the internet, which brings me to my question. Is it possible to make a connection to a computer over the internet, and through a router, if the computer's public IP is known, and a port is agreed on before hand? I'm not that familiar with how a router functions, or what effect a firewall would have on this, but I was just wondering if it would be possible to make a connection given I know the public IP of the other computer, but without any code changes, or an intermediate "Master Server". Sorry if this question has been asked a thousand times before (and I'm sure it has), but I read the FAQ and didn't quite understand if this was possible. Thanks in advance.
My Current Project Angels 22 (4E5)
If you agree beforehand, the easiest thing to do is to port forward the port in question from your router to your computer. Most routers support some kind of port forwarding in their configuration (check the manual).
enum Bool { True, False, FileNotFound };
Advertisement
Yeah, I just want to be able to test it out with my friend outside of a LAN, so its not like I need any matchmaking functionality or anything. Thanks for the reply, I'll check my router's manual and see if it supports packet forwarding.

BTW, if I'm behind a router and he's behind a router, do both of them need to forward the packets?
My Current Project Angels 22 (4E5)
The term to look for is "port forwarding."

If your game is host-based -- i e, one of you "host" and the other "connect," then only the "host" needs to have port forwarding set up.

Another option that some firewalls have is "DMZ" -- it's kind of like port forwarding, for all possible ports :-)
enum Bool { True, False, FileNotFound };
Ah, thanks alot for your help, rate++!
My Current Project Angels 22 (4E5)

This topic is closed to new replies.

Advertisement