First steps in Networking

Hello everyone! I created a simple multiplayers chat. A player launch the server and the other enter as a client!
In LAN everything works fine.

Now I want to try it outside of my house and I want to connect two distants computers via Internet.

I launch the server at my home setting:

ip 127.0.0.1
port 3000 (is opened in router)

and I send my public IP and the port I’ve used to my friend.

nothing happens! is this standard procedure? or need I for tools that not even imagine? Thanks

127.0.0.1 refers to localhost and is not routed on the network.
you will need to set a static route from the router to the lan ip of your server where the server instance is running on

Server:

ip 192.168.1.12 (my static IP)
port 3000

something like this?

192 is a private IP address, you need your public IP.

Go to www.whatismyip.com and it will tell you there what your public IP is. You will also need to make sure you give him the correct port :slight_smile:

Server at ma Pc’s home:

IP 8x.2xx.1x.17x

port 3000

Start Server

Client at my friend’s home

IP 8x.2xx.1x.17x
port 3000?

Play as client

Is this the correct configuration?

IP addresses wont match, just so you know. Yours will be different to theirs. But they will need to know yours, whereas you dont necessarily need to know theirs… Does that make sense haha

you need to route the port from the public ip that is connected to the internet to the internal ip of the host where the server runs on and make sure it’s not blocked by firewalls

appels can you rewrite the follow configuration so I’ll understand?

Server at ma Pc’s home:
IP: ?
Port:?

Client at my friend’s home
IP:?
Port:?

I have not firewalls and I can open ports of my router!

you don’t need your friends ip address, i’m talking about the routing on your LAN.
your computer with the server instance ( gameserver ) is on a private ip ( 192.)
your router or whatever box that is connected to the internet has a public ip on the internet side and a private ip on the LAN side.
So you need a route from the router or box thats connected to the internet to your computer with the LAN ip.
So if your router has ip 8x.2xx.1x.17x, it will need a static route to ip 192.

If you google on ‘port forwarding’ you’ll find plenty of info.
Once the route is in place, your friend can connect to your gameserver by using the public internet ip address of your router ( 8x.2xx.1x.17x)
Hope this somewhat clear to you now.

If you are having trouble working out your port forwarding, remove your router and set the internet connection up on your computer so you wont have to do it. But it is far easier to just do the port forwarding :slight_smile:

You can find out what you and your friend’s IP is by going here: http://www.whatismyip.com/

ok I’ll try soon. Another question!

I understand that many people use the native tools: Masterserver, Facilitator, etc etc,

is another way to do what I want?

In this case is simple or complicated?

Connencted!! :):slight_smile: thanks. It was a closed port!