Jump to content

Can’t connect to unturned server via my public IP

SHOOK_Linus
Go to solution Solved by SHOOK_Linus,
3 hours ago, Windows7ge said:

Timed out would mean it didn't get a reply but the router didn't block the connection. So you're probably getting through to the machine (or the network at least) but the machine isn't replying (or the IP is wrong). Could be firewall related on the server, could be network related.

 

Referencing the photo:

Your OP says .195

The pic says .185

Was this a mistype in the OP or could this be the issue?

That was a mistype, I have found the problem, the server I’m using doesn’t allow connections via the public IP that the server is being hosted on. So any computer in my LAN could not connect via my public IP, but if I tried connecting else where it works (which is the goal of all this), I found it out by connecting my laptop to my mobile hotspot and using the public IP then finding out that it works, so I have to connect at my house on my LAN by using the 192.168.0.185, but everyone else can connect by using my public IP, I just figured that if I couldn’t connect with my public IP, no one could as I’ve used other servers that let you, weird, thanks for the help though!

I setup and have been running an Unturned 3.0 server on my PC, I am able to connect via typing localhost with the port on 27015 and by typing 192.168.0.195 (the router's IP for my computer). But as soon as I try typing my public IP (won't be sharing for security reasons) with the same port, it won't let me connect saying "connection failed". I have ports 27015 - 27018 forwarded to my router (using TCP and UDP) and had a software that confirmed they were opened properly (https://imgur.com/a/Czre4 , in this photo I tested all the ports I opened and the port after, and as you can see, all the ports I opened were successful except for the one I didn't). I have made inbound and outbound exceptions for both Unturned and my server in my firewall, and change my PC's IP to static (not my router's though) I also can connect to my server via another computer on the same LAN network by using 192.168.0.185. SO TL;DR: I did everything you're supposed to (and then some) but I can't connect to my server with my public IP address, but can with localhost.

Link to comment
Share on other sites

Link to post
Share on other sites

you mean from outside your house? because the public ip doesn't exist from within the same network...

Primary System

  • CPU
    Ryzen R6 5700X
  • Motherboard
    MSI B350M mortar arctic
  • RAM
    32GB Corsair RGB 3600MT/s CAS18
  • GPU
    Zotac RTX 3070 OC
  • Case
    kind of a mess
  • Storage
    WD black NVMe SSD 500GB & 1TB samsung Sata ssd & x 1TB WD blue & x 3TB Seagate
  • PSU
    corsair RM750X white
  • Display(s)
    1440p 21:9 100Hz
Link to comment
Share on other sites

Link to post
Share on other sites

Sounds like there's an issue with either your firewall on your router or the port forwarding.

Specs: CPU - Intel i7 8700K @ 5GHz | GPU - Gigabyte GTX 970 G1 Gaming | Motherboard - ASUS Strix Z370-G WIFI AC | RAM - XPG Gammix DDR4-3000MHz 32GB (2x16GB) | Main Drive - Samsung 850 Evo 500GB M.2 | Other Drives - 7TB/3 Drives | CPU Cooler - Corsair H100i Pro | Case - Fractal Design Define C Mini TG | Power Supply - EVGA G3 850W

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, SquintyG33Rs said:

you mean from outside your house? because the public ip doesn't exist from within the same network...

That's not the issue. If you try to access an IP that isn't in the computers ARP table it will query the router. The router if it doesn't have it in its table will query the DNS servers. Since the IP assigned to the WAN interface is the router itself you can connect to it from within the private network. The router will just forward the request to itself. From there port forwarding should be configured to connect to a specific internal host.

 

Basically you're connecting to a machine within your network by first leaving your network. Similarly I can connect to my SSH/SFTP server from within my network using either the servers IP or my houses public IP. Both will work just that one is unnecessary.

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, SquintyG33Rs said:

you mean from outside your house? because the public ip doesn't exist from within the same network...

I’ll try having someone else connect and see if they can or not, I’ll let you know what happens.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, TheKDub said:

Sounds like there's an issue with either your firewall on your router or the port forwarding.

The router’s firewall is disabled and the port forwarding is working (reference to the picture in the OP)

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Windows7ge said:

That's not the issue. If you try to access an IP that isn't in the computers ARP table it will query the router. The router if it doesn't have it in its table will query the DNS servers. Since the IP assigned to the WAN interface is the router itself you can connect to it from within the private network. The router will just forward the request to itself. From there port forwarding should be configured to connect to a specific internal host.

 

Basically you're connecting to a machine within your network by first leaving your network. Similarly I can connect to my SSH/SFTP server from within my network using either the servers IP or my houses public IP. Both will work just that one is unnecessary.

Any idea on why mine isn’t working like this?

Link to comment
Share on other sites

Link to post
Share on other sites

Did you set your computer to a static IP and make sure the ports forwarded & the static IP are correct?

 

Next suspects would be either router firewall or windows firewall.

Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, Windows7ge said:

Did you set your computer to a static IP and make sure the ports forwarded & the static IP are correct?

 

Next suspects would be either router firewall or windows firewall.

The ports forwarded are correct, I’ve checked them a lot, 27015-27018. I will send you a picture of the static IP settings box tomorrow, my computer is currently off, but I’m pretty sure it works, as I can still connect to the internet. I have the router firewall turned off entirely, and the windows firewall for private connections is also off, I’ve had the public one off during testing as well though, it still won’t connect.

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, SHOOK_Linus said:

The ports forwarded are correct, I’ve checked them a lot, 27015-27018. I will send you a picture of the static IP settings box tomorrow, my computer is currently off, but I’m pretty sure it works, as I can still connect to the internet. I have the router firewall turned off entirely, and the windows firewall for private connections is also off, I’ve had the public one off during testing as well though, it still won’t connect.

For this you're going to want to have the firewall enabled and make firewall exceptions on the server anyways. You can add the ports to the firewall exceptions list on the server pretty easily. Port forwarding in itself is basically a firewall exception so if it is setup for UDP&TCP and the 3~4 port numbers you need then it should work fine.

 

I wonder. If you go to a web browser and type in your public IP followed by :27015 (or :27016, :27017, :27018) do you get a special error?

For example on Chrome if I try to connect to a closed port: ###.###.###.### took to long to respond ERR_CONNECTION_TIMED_OUT

But if I try to connect to a open port using Chrome: ###.###.###.### sent an invalid response ERR_INVALID_HTTP_RESPONSE

 

For me the open port is listening for the SSH/SFTP protocol but I tried connecting via HTTP hence the error. This error however does tell you that you got a response back from the server just that your browser cannot translate the response to anything. On occasion the software developers will even make a response for HTTP requests so you get a webpage with just some text saying "protocol mis-match" which would mean you DO have access to the server on that port because it gave you a message back.

 

In short, try this. Provided the server software isn't designed to just drop requests it doesn't understand then you should get some sort of reply error.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Windows7ge said:

For this you're going to want to have the firewall enabled and make firewall exceptions on the server anyways. You can add the ports to the firewall exceptions list on the server pretty easily. Port forwarding in itself is basically a firewall exception so if it is setup for UDP&TCP and the 3~4 port numbers you need then it should work fine.

 

I wonder. If you go to a web browser and type in your public IP followed by :27015 (or :27016, :27017, :27018) do you get a special error?

For example on Chrome if I try to connect to a closed port: ###.###.###.### took to long to respond ERR_CONNECTION_TIMED_OUT

But if I try to connect to a open port using Chrome: ###.###.###.### sent an invalid response ERR_INVALID_HTTP_RESPONSE

 

For me the open port is listening for the SSH/SFTP protocol but I tried connecting via HTTP hence the error. This error however does tell you that you got a response back from the server just that your browser cannot translate the response to anything. On occasion the software developers will even make a response for HTTP requests so you get a webpage with just some text saying "protocol mis-match" which would mean you DO have access to the server on that port because it gave you a message back.

 

In short, try this. Provided the server software isn't designed to just drop requests it doesn't understand then you should get some sort of reply error.

Ok, I’ll try this, thanks, I’ll let you know how it goes

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Kevinlvp said:

Is your IP static?

Yes, only on my PC though

Link to comment
Share on other sites

Link to post
Share on other sites

18 hours ago, Windows7ge said:

For this you're going to want to have the firewall enabled and make firewall exceptions on the server anyways. You can add the ports to the firewall exceptions list on the server pretty easily. Port forwarding in itself is basically a firewall exception so if it is setup for UDP&TCP and the 3~4 port numbers you need then it should work fine.

 

I wonder. If you go to a web browser and type in your public IP followed by :27015 (or :27016, :27017, :27018) do you get a special error?

For example on Chrome if I try to connect to a closed port: ###.###.###.### took to long to respond ERR_CONNECTION_TIMED_OUT

But if I try to connect to a open port using Chrome: ###.###.###.### sent an invalid response ERR_INVALID_HTTP_RESPONSE

 

For me the open port is listening for the SSH/SFTP protocol but I tried connecting via HTTP hence the error. This error however does tell you that you got a response back from the server just that your browser cannot translate the response to anything. On occasion the software developers will even make a response for HTTP requests so you get a webpage with just some text saying "protocol mis-match" which would mean you DO have access to the server on that port because it gave you a message back.

 

In short, try this. Provided the server software isn't designed to just drop requests it doesn't understand then you should get some sort of reply error.

I tried this out and found out something interesting, whenever I use my public IP (###.###.###.###) with :27015 (the open port) like so: ###.###.###.###:27015 in my browser it takes about 30 seconds then gives me ERR_CONNECTION_TIMED_OUT, but whenever I use a closed port (any other 5 digit number) It loads instantly and says ERR_CONNECTION_REFUSED. I tried this with two of my open ports, and got the ERR_CONNECTION_TIMED_OUT from both, then tried two closed ports and got ERR_CONNECTION_REFUSED from both.

Link to comment
Share on other sites

Link to post
Share on other sites

36 minutes ago, SHOOK_Linus said:

I tried this out and found out something interesting, whenever I use my public IP (###.###.###.###) with :27015 (the open port) like so: ###.###.###.###:27015 in my browser it takes about 30 seconds then gives me ERR_CONNECTION_TIMED_OUT, but whenever I use a closed port (any other 5 digit number) It loads instantly and says ERR_CONNECTION_REFUSED. I tried this with two of my open ports, and got the ERR_CONNECTION_TIMED_OUT from both, then tried two closed ports and got ERR_CONNECTION_REFUSED from both.

Timed out would mean it didn't get a reply but the router didn't block the connection. So you're probably getting through to the machine (or the network at least) but the machine isn't replying (or the IP is wrong). Could be firewall related on the server, could be network related.

 

Referencing the photo:

Your OP says .195

The pic says .185

Was this a mistype in the OP or could this be the issue?

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Windows7ge said:

Timed out would mean it didn't get a reply but the router didn't block the connection. So you're probably getting through to the machine (or the network at least) but the machine isn't replying (or the IP is wrong). Could be firewall related on the server, could be network related.

 

Referencing the photo:

Your OP says .195

The pic says .185

Was this a mistype in the OP or could this be the issue?

That was a mistype, I have found the problem, the server I’m using doesn’t allow connections via the public IP that the server is being hosted on. So any computer in my LAN could not connect via my public IP, but if I tried connecting else where it works (which is the goal of all this), I found it out by connecting my laptop to my mobile hotspot and using the public IP then finding out that it works, so I have to connect at my house on my LAN by using the 192.168.0.185, but everyone else can connect by using my public IP, I just figured that if I couldn’t connect with my public IP, no one could as I’ve used other servers that let you, weird, thanks for the help though!

Link to comment
Share on other sites

Link to post
Share on other sites

38 minutes ago, SHOOK_Linus said:

That was a mistype, I have found the problem, the server I’m using doesn’t allow connections via the public IP that the server is being hosted on. So any computer in my LAN could not connect via my public IP, but if I tried connecting else where it works (which is the goal of all this), I found it out by connecting my laptop to my mobile hotspot and using the public IP then finding out that it works, so I have to connect at my house on my LAN by using the 192.168.0.185, but everyone else can connect by using my public IP, I just figured that if I couldn’t connect with my public IP, no one could as I’ve used other servers that let you, weird, thanks for the help though!

Did you say the server doubled as the computer you were running the game on? If you have a dedicated computer running the server and you use a different computer to connect to the game via public IP did that work or fail? Or have you tried that?

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, Windows7ge said:

Did you say the server doubled as the computer you were running the game on? If you have a dedicated computer running the server and you use a different computer to connect to the game via public IP did that work or fail? Or have you tried that?

It doubled as the game computer too yeah, and I used my laptop to try and connect on the same LAN as the one the server was running on via my public IP and that didn’t work, but when I connected my laptop to my mobile hotspot (A different LAN network than that of the server) it would connect via my public IP, which was strange to me...

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, SHOOK_Linus said:

It doubled as the game computer too yeah, and I used my laptop to try and connect on the same LAN as the one the server was running on via my public IP and that didn’t work, but when I connected my laptop to my mobile hotspot (A different LAN network than that of the server) it would connect via my public IP, which was strange to me...

The only things I can think of to cause that might be a MAC address error, possibly something IP related, or the specific protocols used by the server were causing a conflict somehow between your computers IP/MAC the Routers IP/MAC and how the server handles traffic.

 

I'm just not sure. If the server has an error reporting function that pops up an error when you try to connect it might bring some insight as to the actual issue but at least it's working as intended.

 

Just make sure to re-enable the routers firewall & the server firewall & add those port UDP/TCP exceptions to the server firewall if you haven't already.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×