Running a local server HowTo
Problem 1: Can't connect to my external IP from my local PC
This a recipe
- how to run a local server
- and allow others to connect to it
- while connecting locally as well
- even if your router doesn't allow you to connect to your external IP.
This is an issue several people have had in the past. It comes up, when you are setting up a local server and enter your external IP in the ClusterConfig.xml which allows others can connect to it from the outside (assuming you have poked the right holes into you firewall, usually UDP port 3000) and suddenly you cannot connect to your local shard anymore. Some prerequisites:
- <ServerAddress> ..... </ServerAddress>
- This entry in your ClusterConfig.xml MUST match the way you are connecting.
- If you are using <ServerAddress>127.0.0.1</ServerAddress> you MUST enter 127.0.0.1 in the "Address: " field for manual connections on the page with the server list. If you do that noone will be able to connect to your server from the outside.
- If you are using your external IP like <ServerAddress>123.123.123.123</ServerAddress> people from the outside can connect to your server under the assumption you have configured the correct port forwarding in your firewall(s) (Yes - some people use the routers FW + their Windows Firewall...). But - depending on your router you might or might not be successful connecting to your server using that external IP. If you use 127.0.0.1 instead, you will get autherntication errors.
- In the case above the following fix should work:
- Configure a dynamic DNS service, which gives your local server a DNS name.
- Enter the FQDNS name, e.g. myshard.dyndns.org, or whatever you got into your ClusterConfig.xml fields, like: <ServerAddress>myshard.dyndns.org</ServerAddress>
- Also add that name to your windows hosts file. It should be at %windows%\System32\drivers\etc\hosts. You will need admin rights to edit it, so start your editor in admin mode. Being on an admin enabled user account is not enough. The entry should look like:
127.0.0.1 myshard.dyndns.org - Then, after restarting your local server with the new settings and setting up the hosts file you should be able to connect to your local shard. It shouldn't matter, if you are clicking your local servers entry in the server list or entering the dynamic dns name in the manual connection field. For me both methods worked.
Problem 2: Can't connect to my local server, but can connect to my external IP
- Check your firewall settings
- Usually the routers you get from your ISP have a built in firewall to prevent connections from the internet to your home box.
- Normally you can poke holes into this firewall exactly at the ports used by Shards Online. This is called "Port Forwarding"
- The standard port is port 3000 protocol "UDP" - NOT "TCP"!
- The "ServerIndex" Property in your ClusterConfig.xml is added to your Port, so if you have an entry like
<Region ServerIndex="2" Address="myworld.celador" WorldName="Celador" MaxUsers="64" />
the port would be 3002. This is especially important when you are running a cluster locally and are consuming a series of ports, like 3000-300x. - Check your firewall settings 2
- Even if your router is set up correctly there might be a windows firewall running on your local PC and keep blocking traffic. You need to poke holes here too. Either by enabling the Shards Online server application or a port or port range. Check the windows firewall help for configuring it.