• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Can't connect to own server

Smaltz

New Member
Joined
Feb 5, 2016
Messages
8
Reaction score
0
Location
Poland
Hi,
I have problem with my OT. It is hosted on machine in my LAN using my public ip. The server can be accessed from the internet. The problem is that I can't connect to it using other PC in my LAN. I've already tried to edit Hosts file, disabled firewall, antivirus and it doesn't help. It can't be accessed using both my public ip and host local ip. It appears that my router doesn't support NAT loopback. Is there anything else that i can do to connect to my own server from LAN?
 
first off,
The local machine that is running the server what is his internal ip?
Have you configured this to be static? (so that it is always the same).

once you're sure that the internal ip is a static one.
make sure you have forwarded the ports properly in your router so it can be accessed from the internet.

Also please provide more information on your problem than just a vague discription.
I.e what you have done so far to solve this problem.
The settings you've updated in your router.
What os your server is running.
What distro you're using.
Your config.lua (in [code ] tags).[/ code]
 
Last edited:
Machine uses 192.168.1.100 ip, it was set to be static. Ports are forwarded, my friend already tested it. On my router i forwarded 7171 and 7172, as well as port for www server. Server uses ubuntu server 15.10. Distro that i'm using is TFS 1.2.
To solve my problem i already tried disabling security (firewall, antivirus) on both machines, created no-ip host, edited hosts file in Windows and i tried to create static route (last one without success, it may help but I'm not sure how to properly set it up). To connect to server i tried my WAN ip and LAN ip of server.
Code:
ip = "my wan ip (the one from whatismyip)"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
 
Try to use "localhost" to connect from the PC's within your Local Area Network.
If localhost ain't working try IP4 Adress. (How to find?: Hold Windows Button + R > type in CMD > enter > in cmd type ipconfig /all > enter.
 
So, you have tried with the localhost IP and failed. Do you tried with the IP that shows the ipconfig command? 192.x.xx.x

If your friends can join the server successfully from another network and you can't join from the local network you doing something wrong while putting the IP
 
I'm not sure if that's my fault. Other services run without any problem (for example www server or ssh). They use lan ip and port forward takes care of accessibilty from internet. TFS for some reason has to use wan ip or otherwise it won't be accessibile from the internet. When I start the server using server lan ip my friend is only able to login and choose character but he can't enter the game.
 
have you tryed to change the static ip for your hosting machine?
It might be that some internal ip's conflict with eachother.
You could also reboot your router when you're done making those changes It's a long shot but it might fix somethig.
(for you router to reboot properly take out the power supply and wait about 10 seconds then plug it back in).

could you post the data that the ifconfig command gives on your hosting machine?

Also could you provide us with your external ip? I'll try to log in on your server to confirm that it works ;)
 
I've managed to fix my problem. After hours of browsing through server code I found out that after login server is sending gameworld ip to client. I've done some tweaks to that and now it works :D Thanks everyone for help.
 
The problem was that my router (and many other) doesn't support nat loopback, which means that they can't connect machines behind it back to the same public ip address. TFS after you choose character sends you ip from config.lua, and that's the ip you connect to with your character. Beacuse my config.lua ip was my public address I couldn't connect to own server because of what I explained earlier. To solve that i added two values to config.lua: LAN ip of server (192.x.x.x) and account name of player who connects from LAN and I changed server code to check if connecting player name is matching the one from config.lua and if it does server sends LAN ip, otherwise it sends the public one.

For better explanation:

Earlier:

Connecting to LAN ip -> Choosing character -> Server sends public ip (or the one from config.lua) as gameworld ip -> Connecting character to public ip -> Router not connecting because of missing nat loopback feature
Connecting to public ip -> Router not connecting because of missing nat loopback feature

Now:
Connecting to LAN ip -> Choosing character -> Server checks account name if it's the one that connects to local ip of server -> Server sends lan ip as gameworld ip -> Connection :D
Connecting to public ip -> Router not connecting because of missing nat loopback feature, but now it's not a problem because I can connect via LAN address
 
Could you tell me what code you added to enable this functionality? I have exactly the same problem but I do not know the config.lua syntax to solve my problem.
 
Hi, I've the same problem. Which code you have added to solve that? I've the source code of my server here and if you can send me the code I can recompile my otserver. Please help me.
 
Yep, When i come up with another idea I'm going to change it :p

Just check the IP address of whoever is connecting and if the IP address matches the server's IP in config.lua, have the server send the LAN address instead?

If the IP of whoever is connecting matches your server's IP it means it's on the same network.
 
Is someone still active in TFS thesedays? and if so.. could be helping me find where i could check the ip and segregate the connections like discussed here before?

i want TFS to distinguish internal and external networking just like senior @Smaltz did but with the suggestion of @Delirium..

Imagine this cenario:

my network external ip is 333.22.11.000 and my local server is 192.168.3.1 clients are on 192.168.3.(2 ~ 3) which are 2 developers and other clients are running the game which are players with many differents ips, in this case nat loopback is not an option too.. so server should check if the client external ip (333.22.11.000 in our case) is the same of my network external ip, in that case instead TFS be using 333.22.11.000 to receive packages it receives from local server which is 192.168.3.1.. all other external IP should work as it is.. players and developers should access and test the server in production, of course each new build would imply in mass kick, but i have an idea of developing a match type of otserver which players won't lose their contents if server suddenly shuts

i've lost a day messing with all TFS networking but this boost lib is too damm crazy.. i'll be deeply glad if someone could help me.
 
Back
Top