• 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!

Port Forwarding and Connection

Limos

Senator
Premium User
Joined
Jun 7, 2010
Messages
10,013
Solutions
8
Reaction score
3,055
Location
Netherlands
Because of the amount of Support threads about port forwarding and connection issues I decided to make a tutorial about it with explanations of the basic things.


Port Forwarding

Port forwarding works different on every router, therefore there are different tutorials for (almost) every router.
There are several websites for that, the most known one is portforward.com
The tutorials on portforward.com are often missing required things you need to do so you can also try YouTube, type your router in search with the words port forwarding and you will often find video tutorials how to open ports in your router.

Incase it's not clear enough in the port forward tutorial you found for your router.
The IP you have to enter when you open the ports is your IPv4 address. You can find this by typing cmd in start -> search and type ipconfig.
The default gateway is the IP you have to enter in your internet browser to connect to your router.
-2kwSuSO5.png


For OTS you have to open 3 ports.
  • 7171
  • 7172
  • 80
Port 7171 is the login port, to connect to the character list.
Port 7172 is the game port, to login from the character list ingame.
Port 80 is for your website, if port 80 is open, people can connect to your website.




Connection


1. I opened the ports but people still can't connect to my server/website

The (windows) firewall blocks the ports. So you can turn it off or open the ports in it.
If you are not sure how to do this, there are alot of tutorials about it on YouTube.
Other things that might block the ports are programs like virusscanners, so if you have one and the ports still aren't opened, you can try to turn off that aswell.
It's also possible that firewalls/viruscanners block the server, so you can add the server as exception or turn them off.

To test if the ports are opened you can use this site from @HalfAway.
http://www.************/index.php?portchecker
Make sure your server and website is online when you test it else it will say they are closed even when they are open.
You can also use other (not OT related) portcheck sites like www.canyouseeme.org, but it's possible that these sites show the ports as closed when they are actually open (depens on router settings).
So I would recommend to use the halfaway portchecker instead.

If port 80 is still not opened but the other ports are, it's possible your ISP is blocking it, so you can call them and ask to unblock it.
It's also possible the other ports are blocked this way, but it's less common.


2. Which IPs should be used

In config.lua you have to add your global ip or your domain/no-ip address.
If you don't know how to set up a free domain, you can follow this tutorial.
People also have to use this IP to connect to your server and website.
If you used your domain in config.lua and people can't login, test with your global ip to make sure there is nothing wrong with your domain.
If people can connect with your global ip, try to create a new domain and use that.


3. I can't connect to my own server but other people can

It's normal if you can't connect with your global ip to your server or website if you connect from the computer that hosts the server/website.
There are other IPs you can use instead.
You can try to use 127.0.0.1, your IPv4 address or add your domain to hosts and use your domain to connect: https://otland.net/threads/help-with-my-webpage.223416/#post-2146872


For further explanation:

Open your hosts file (C:/Windows/system32/drivers/etc/hosts in Windows).
I recommend to use notepad++ to do this incase you accidentally do save as which will turn the hosts file in a .txt file when you use text edit programs like the default windows notepad and then it won't work.
If you can't save the hosts file, make sure it's only opened once and run notepad++ as administrator.

In the hosts file write your IPv4 address and next to that your domain.
29rx14K62.png

Then add your domain in config.lua and use your domain in your IP Changer to connect to your server.
When you have the same problem when you connect from a different computer from the same network, you can do the same thing there, with the IPv4 address of the host pc.
Note: This workaround doesn't work for some older (Crying Damson) versions, for these versions use your global ip in config.lua and your IPv4 address in your IP Changer.


4. Port 80 is opened but people are connected to my router page instead of my website

Sometimes port 80 is already opened to be able to acces your router from a different network.
The portchecker tools will show that port 80 is opened, but when people write your global ip/domain, they will see your router page instead of your website.
In that case you can just open port 80 the same way as 7171 and 7172, so with your IPv4 address, this way people will connect to your website.


5. My ports were opened before and now they are closed

It's possible that your IPv4 address changes when you restart your computer, if that happens you have to set up a Static IP Address.
If you don't know how to do that, you can use these tutorials from portforward.com: http://portforward.com/networking/staticip.htm
You can also find alot of tutorials about it on YouTube.


6. How to connect from different computers from the same network without port forwarding

If you can't open your ports and just want to play for example with friends or family in your house, then you can use the IPv4 address of the host pc in config.lua and in the IP Changer, also from other pcs you have to use the IPv4 address from the host pc in the IP Changer.


7. I can't connect at all to my server, not even on localhost

There can be all kinds of things wrong besides port, firewall/virusscanner or wrong IP related issues.
Look in your console if it shows errors, it is usually related to config.lua values, the database or login.lua (or an other creaturescript with type login).

login.lua
When the problem is with a login creaturescript, it will show that script in the error.
If you don't know how to solve this error you can ask for help in Support.

Database
Database errors that cause the character from not being able to login can be because of wrong character values in the database, such as not existing group ids.
For that error you can look in data/XML/groups.xml what the groups are in your datapack and change it in your database (or add more groups to your groups.xml).
If you can't connect to your server because the password is incorrect, then your server is probable using sha1 encryption for passwords while your password in the database is plain.
To change the plain password to sha1 you can use websites or a query.

config.lua
If you get errors such as these.
Code:
[ServicePort::open] Error: bind: The requested address is not valid in its context
[ServicePort::open] Error: An invalid argument was supplied
It can be solved by setting bindOnlyGlobalAddress (or something similar since it's not called the same in every server) in config.lua to false/"no".
Other config related issues can be caused if you use a config.lua from a different server, which means some variables will be missing or set to wrong values.
Which can result in into client errors such as "Disconnected from server".
So make sure you use the config.lua that was made for your server version.

Also outdated IP Changers can cause connection issues, so you can try to use the latest OTLand IP Changer.
 
Last edited:
host file wont save always say see if this file open with othere program i close all program and restart pc and still won save :S what i can do i open not with run as admin~
 
host file wont save always say see if this file open with othere program i close all program and restart pc and still won save :S what i can do i open not with run as admin~

You create a copy and change it, then save and move it back.
 
Is "Te-Data" your router? Open a thread then on your browser type 192.168.1.1 then screenshot the webpage. DONT forget to tag me with @
 
Limos, i'm gonna open a server and my ports are open. when i use my global ip in the config.lua it doesn't open the server. what can i do? I would love some help.
NEWS: i changed
bindOnlyGlobalAddress = "no" (it was set on Yes)
and all my friends can connect now, but i can't enter.... UGH
 
Last edited:
Limos, i'm gonna open a server and my ports are open. when i use my global ip in the config.lua it doesn't open the server. what can i do? I would love some help.
I'm willing to help you. What do you mean with "Doesn't open the server" does the server crash? or you can't connect?
 
Limos, i'm gonna open a server and my ports are open. when i use my global ip in the config.lua it doesn't open the server. what can i do? I would love some help.
NEWS: i changed
bindOnlyGlobalAddress = "no" (it was set on Yes)
and all my friends can connect now, but i can't enter.... UGH
Already tried to use your IPv4 address in your IP Changer?
Else you can also try to add your domain to hosts as explained in the "I can't connect to my own server but other people can" part.
 
Hello guys. Im having trouble on connect to my OTS.

I have opened the ports 7171 and 7172, and i cant connect at all with my Global IP on config.lua. If i try my global, i have errors. If i try localhost or my local ipv4, i can reach character selection, but get error on next step.

Any clue?

PS: Im hosting my DB on a vagrant VM.

Im using MAC, and no firewall active.
 
Solved in teamviewer. He created a domain and added it with his IPv4 address to hosts.
 
Solved in teamviewer. He created a domain and added it with his IPv4 address to hosts.

Right, thanks again for ur help. As he said, i created a no-ip domain, and added it to my hosts as my IPv4.
 
Help me plz , i have a tfs 0.4 rev 3777 (Linux) and i have all the ports opened an checkeds 7171, 7172, 80
i can play in the localhost and my friends in another networks, but i cant play in other lan computers in mi house only display charlist... but connection refused enter to game but i can create a account and char in the webpage.

im using all ips global ip addres and ipv4 ip addres..

[13:44:13.907] > Global IP address: 148.240.105.136
[13:44:13.908] > Local IP address(es): 127.0.1.1
[13:44:13.908] > Bound ports: 7171 7172
[13:44:13.909] >> Everything smells good, server is starting up...
[13:44:13.909] >> Noxus server Online!
 
Help me plz , i have a tfs 0.4 rev 3777 (Linux) and i have all the ports opened an checkeds 7171, 7172, 80
i can play in the localhost and my friends in another networks, but i cant play in other lan computers in mi house only display charlist... but connection refused enter to game but i can create a account and char in the webpage.

im using all ips global ip addres and ipv4 ip addres..

[13:44:13.907] > Global IP address: 148.240.105.136
[13:44:13.908] > Local IP address(es): 127.0.1.1
[13:44:13.908] > Bound ports: 7171 7172
[13:44:13.909] >> Everything smells good, server is starting up...
[13:44:13.909] >> Noxus server Online!
Try to use the IPv4 address (from the host pc) in the IP Changer, else you can try to add your domain to hosts as explained in the "I can't login to my own server but other people can" part.
In the hosts file write your IPv4 address and next to that your domain.
29rx14K62.png

Then add your domain in config.lua and use your domain in your IP Changer to connect to your server.
When you have the same problem when you connect from a different computer from the same network, you can do the same thing there, with the IPv4 address of the host pc.
 
Last edited:
Try to use the IPv4 address (from the host pc) in the IP Changer, else you can try to add your domain to hosts as explained in the "I can't login to my own server but other people can" part.
In the hosts file write your IPv4 address and next to that your domain.
29rx14K62.png

Then add your domain in config.lua and use your domain in your IP Changer to connect to your server.
When you have the same problem when you connect from a different computer from the same network, you can do the same thing there, with the IPv4 address of the host pc.

I tried that and nothing... i can play in the host computer.. and other networks computers but i can't play in my other lan computers.
 
Back
Top