-1
I have created some programs like a multiplayer ping pong game, chat and others, using socket
. They all work perfectly and I can connect to other devices that are connected on the same network as me, but in all of them, I can’t connect to a different network.
I’ll let here the link to the repository of a program I recently created.
I searched deep, and first discovered that there are two types of ip (private and public). In the old days I couldn’t connect, probably because I was trying to use a private ip. So here’s my first question... How do I create the server with that my program using public ip ? I have tried using public ip and what I had done before was the following:
1 - I got my Public IP
2 - I opened the "Network and Sharing Center" > "Change adapter settings"
3 - I selected the network, clicked on "property" and selected "TCP/IP protocol version 4"
4 - I checked the option "Use the following IP address" and put there the public ip.
After that, I couldn’t connect anywhere, couldn’t open sites or anything like that (as I recall, he said it was a DNS glitch or something) and I had to restore the system settings because, undo the changes I made didn’t work. I did something wrong ? For me to use the public IP I need to talk to the provider or something like ?
I spoke to a friend of mine, and he recommended I try to use Hamachi. So when I created the server, I passed the hamachi ipv4 just like I do when I go to play Minecraft with a friend on LAN. However, even with hamachi I could not connect to another network.
Anyone there who is experienced in networking can tell me step by step what to do to connect somehow in another network using IP ? And already taking advantage, which is the correct Port number to use ? I’m using port number 60 or 80.
Somebody please help me!
– JeanExtreme002
You probably already found the problem, but when using some port, I advise you to use a high port number and check if there are no other applications using the same port, port 80 is used for http by default, your modem contains both ips, audience and private, your pc uses the internal network of your home that would be lan and who does the communication to the public network is your modem, already tried to redirect the ports in its configuration? research forward port
– Guilherme França de Oliveira