unknown IP or changing IP

moonbug12

Member
hello i have downloaded a networking game of the marketplace, it works well on my pc using the loopback ip, but when i change it too command prompts ipv4 it doesn't connect from another computer.
i am wondering does my ip change? randomly or when restarting computer, second what is the difference between command prompt ipv4 vs googling my ip address? the port forwarding i left the same, should i change it?


"
host = "Censored" //"127.0.0.1"
port = 12567
"
 

chamaeleon

Member
Are both computers on the same local network? If so, you're probably going to use an address that might look like 192.168.x.x.
 

Mr Magnus

Viking King
> i am wondering does my ip change?

It can, yes. It doesn't randomly do so, but whenever your computer is given a IP address by your router it can be a new IP address if that's how it goes.

> second what is the difference between command prompt ipv4 vs googling my ip address

Command prompt can also show you your internal IP address, which is the IP address your device was specifically given by your router so that it can know what exact device it should send packages to. "Whatsmyaddress" sites like you can find on the internet can only show you your external IP address, which is essentially what IP address your router has according to the ISP, and is how other computers not on your network locate your router, who then locates your computer.

Generally, if you're testing a game with two computers on the same network you'll want to use the internal IP that does not need to be port forwarded. It's usually something in the 192.000.00.0 range
 

moonbug12

Member
ok so i have my ip "Censored" which is external, i found out i need to change it to my internal ip ipv4 192.168.0.112, so basically i think i need to access the external ip the change it to my internal ip? does this sound right or do i need to use a socket to get it to shoot to my internal ip?

sorry about this but there is no actual examples on how to do this, connect 2 separate computers on 2 different networks.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Sharing your external IP publicly is a bad idea. This could be used to track down your physical location. I took the liberty of censoring it for you.

i am wondering does my ip change? randomly or when restarting computer
It may change.

Your private IP may change if your router uses a DHCP server to assign private IPs automatically. You can override this by manually assigning a static IP to your connected devices.
Your external IP may change periodically if there's an IP shortage in your area. There are more devices than there are valid IPv4 addresses, so ISPs sometimes have to shuffle them around once in a while.

ok so i have my ip "Censored" which is external, i found out i need to change it to my internal ip ipv4 192.168.0.112, so basically i think i need to access the external ip the change it to my internal ip? does this sound right or do i need to use a socket to get it to shoot to my internal ip?
Doesn't quite sound right. You don't change your external IP. You couldn't do that if you wanted to - at least not to an IP of your choice - and although you could certainly force your ISP to assign a new one if your IP is dynamic, that wouldn't help you do what you're trying to do.

If you want your device to act as a server accessible by a client running on a device that's on an external network, you need to:
- open the port your server uses for the device it will run on in your router's settings (aka port forwarding)
- open the port your server uses in the firewall settings of the device it runs on
- run the server to start listening on the port

You can check whether you properly took care of all required steps using a port checker such as https://www.yougetsignal.com/tools/open-ports/. Enter your external IP and the port you wish to check after following all steps above... and I mean literally all, including running the server.
 

moonbug12

Member
thank you, so i need to connect to my external ip then port forward to my pc, ok thanks
looks like i need to do some research on some port forwarding, basically i want to set a server up separate to the client.
there both built in one, sorry i havent been on the forums for about six years.
i will try and attach the demo so you get an idea of what im working with

this is the create event, where the ip and port are selected.


/// @description Initialization and Connect
var host, port, joinspace, recvinstance, version, hashlen, key;
host = "***.**.*.***" //"127.0.0.1" // ip here external one
port = 12567 //port here
joinspace = 1
recvinstance = id
version = "The Particles"
hashlen = 10
key = "MyKey"

buffer_seek(NsSendBuffer, buffer_seek_start, 0) //Server can read this buffer in the TypeClientConnected by NsRecvBuffer
tcp_handle = ns_create_client_async(host, port, joinspace, recvinstance, version, hashlen, key)
if(!tcp_handle)
{
show_message("Server connection failed.")
game_end()
exit
}

ping = 0 //Get ping in the alarm[1]
alarm[0] = room_speed //Server condition check

application_surface_enable(false)
draw_set_colour(c_white)



thats the code, inside the example it is the closest i have found to one that works, i know its like cheating but i would like to make a working example to learn from, just the basic port forwarding to a server at an ip address?
there is no tutorials, i cant find any besides this and there is no youtube videos explaining the whole process of networking, making it very hard, and the docs well you only get 10% of what you can do so its not much of a help. the tutorial is downloadable from the marketplace for free, its called "networking with space".

this image is a diagram of my internet, i have a d-link separating 2 areas, the d-link changes the ip address a lot, so area 2 i cant seem get an ip address?
 

Attachments

Last edited:

TsukaYuriko

☄️
Forum Staff
Moderator
this image is a diagram of my internet, i have a d-link separating 2 areas, the d-link changes the ip address a lot, so area 2 i cant seem get an ip address?
D-Link is the name of a manufacturer of various network devices, not the name of an actual device, so I can't tell what you have based on your description. Kinda like how you couldn't tell me the model of my PC if I told you that I use a Dell.

Either way, look up the manufacturer of your router, the router's model and the term "port forward" to find port forwarding instructions (Example: "avm fritzbox 7390 port forward").
 

moonbug12

Member
when i say d-link it uses a power cable/ extension cord to get the internet 50m away from the house, since it changes the ip every few minutes i cant seem to pinpoint it, ill look into port forwarding and find out my d-links model.
 
Top