Struggling with a private server WAN connection

    Joined
    Oct 24, 2013
    Messages
    4
    Reaction score
    1
    • Legacy Citizen
    I have port forwarded (According to the programs and sites that check if the port is open I succeeded) and I have been able to connect to the server with my computers static IPV4 address/localhost and works good.
    The trouble comes when I or and friend attempt to log into it through the public IP I get the 'SocketTimeoutException: failed to connect' error, in the log there is no sign of my client connecting to my server at all, either. The server appears on the server list with 99999 ping with 'N/A' in the other boxes.
    I have made exceptions in the firewall for Java, and the port I am using which started off with 4242 and I tried a new one to see if that was the issue which is currently 7622, Starmade-Launcher and Starter are exceptions also. I've tried turning the server on through the launcher and the .bat file and connecting, along with disabling my Avast Antivirus, Windows Firewall and the firewall on my modem. There's gotta be something that I'm not thinking about that's still preventing an outside source from accessing it. I've got Windows 7 64 Bit for my OS.

    Nothings worked, and the reason why I'm using my public IP to try to connect is I'm making sure other people will be able to connect before someone asks. Paying for a server host is out of the question. Thanks in advance.
    [doublepost=1509236458,1509235304][/doublepost]Nevermind, I did something very stupid and it works fine now.
     
    Joined
    Oct 24, 2013
    Messages
    4
    Reaction score
    1
    • Legacy Citizen
    Yeah apparently for my modem (So I read) you cannot enter the server via the WAN IP, it prevents it. That meant I could not try to simulate whether or not someone else could access it. I was also telling my friend to use my PC's static IP instead of the public one so that was my goof.
     
    • Like
    Reactions: Batavium
    Joined
    Jan 28, 2015
    Messages
    492
    Reaction score
    149
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 3
    Nevermind, I did something very stupid and it works fine now.
    Yeah apparently for my modem (So I read) you cannot enter the server via the WAN IP, it prevents it. That meant I could not try to simulate whether or not someone else could access it. I was also telling my friend to use my PC's static IP instead of the public one so that was my goof.
    Thank you for clearing up the root cause of your problem. That way other people who run into the same issue may find a use in your post.

    The modem/router setting at fault could have been this one:

    Prevent ping from WAN
    Prevent ping from LAN

    You then either tick or untick the box depending on needs.

    As a tip you do not have to list the server in the server list if it is just a simple home hosted server. This to partially prevent people from trying to hack your modem/router.

    You could make a forum post in the host server section. Where you say the ip needed to connect to your server and then have people connect manually. Just beware to update your post whenever this ip changes. You could even ask them to PM you on this forum for the server adress incase you do not want to post it publicly at all with or without a white list.

    StarMade server.cfg file look at these lines:

    ANNOUNCE_SERVER_TO_SERVERLIST = false //null
    HOST_NAME_TO_ANNOUNCE_TO_SERVER_LIST = //null
    SERVER_LIST_NAME = NoName //null
    SERVER_LIST_DESCRIPTION = NoDescription //null
    USE_WHITELIST = false //null

    Be sure to add your name to the admins.txt file else EVERYBODY has admin rights on the server.
    Do this in combination with these server.cfg settings. Do NOT run a server without AUTHENTICATION!

    USE_STARMADE_AUTHENTICATION = true //null
    REQUIRE_STARMADE_AUTHENTICATION = true //null

    Some usefull posts:

    How to setup a stable server with links to how pirates work

    How the NPC works though i strongly recomment to NOT use the NPC at this stage.
     
    Last edited:
    • Like
    Reactions: Teddy7111
    Joined
    Oct 24, 2013
    Messages
    4
    Reaction score
    1
    • Legacy Citizen
    Yeah, I have since removed it from the server list for now and I do use the authentication. Thanks
     
    Joined
    Nov 19, 2017
    Messages
    3
    Reaction score
    1
    Sorry for hijacking thread but, I also am having an issue with setting up a local play with my son over a WAN. The computers are in the same room and we can ping each other fine. We are both able to connect to a server from the server list. I have given him my IP address of 10.0.0.xx:4242 but I get the same socket time out error and my server is listed on the list but has a purple line through it and is under the not compatible and non responsive buttons on the server list that my son can see. I was informed at the steam forums that if you wish to do a local play you don't need the port forwarding and you he should just be able to put my IP into the entry and connect.
    I have tried turning of my firewalls and port forwarding, but for a month I cannot get this working.

    Frustrated.....
     
    Joined
    Jan 28, 2015
    Messages
    492
    Reaction score
    149
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 3
    Sorry for hijacking thread but, I also am having an issue with setting up a local play with my son over a WAN.
    For local play you do not need an external WAN connection. You just play over the local LAN or WLAN. To play together you need three computers. One being the server.

    You need to look into your router so that the computers can access each other. Sometimes computers are set as stand alone in the router to prevent hacking. It might be possible to ping those computers but you do not get full access.

    A typical setup would be like:

    ip 178.168.0.1 for the server.
    ip 178.168.0.2 player 1
    ip 178.168.0.3 player 2

    192.168.0.0 to 3 see Valck post below typo sorry I read over it to :oops:

    These are internal ip ranges. Ip 10.0.0.xx could have a special function within your router. Be sure you manually set all the computers ip adres so that they do not change on reboot.

    It is not possible to connect two client computers. You can not both play the game and connect to each other computer. If you only have two computers then set one as the server and let the other connect to it. That should work. To get a second player in as well you need a third computer.

    Set the computer with the strongest CPU as the server. Give your best videocards to the client computers since a server has little need for it.
     
    Last edited:
    Joined
    Jun 27, 2013
    Messages
    896
    Reaction score
    166
    ip 178.168.0.1 for the server.
    ip 178.168.0.2 player 1
    ip 178.168.0.3 player 2

    These are internal ip ranges.
    These are not internal IP ranges. Do not use these in a local area network.

    Private IP ranges are 172.16.0.0 – 172.31.255.255 and 192.168.0.0 – 192.168.255.255. Make sure you both use the same IP range, eg. one player uses 172.16.0.1 and the other 172.16.0.2, or one 192.168.0.1 and the other 192.168.0.2


    It is not possible to connect two client computers. You can not both play the game and connect to each other computer. If you only have two computers then set one as the server and let the other connect to it. That should work. To get a second player in as well you need a third computer.
    It is perfectly possible to run client and server on the same machine, if your processor and memory can handle it. You may manage with two computers for two players, the more powerful machine acting as server and client at the same time, the weaker machine being just client.
    Again, this is highly dependent on the capability of your specific hardware, and on how much you and your friends are willing to accept lag; the more players you want to serve, the more a dedicated machine will become a necessity.
     
    • Like
    Reactions: Batavium
    Joined
    Jun 19, 2016
    Messages
    98
    Reaction score
    110
    • Legacy Citizen 7
    • Purchased!
    Sorry for hijacking thread but, I also am having an issue with setting up a local play with my son over a WAN. The computers are in the same room and we can ping each other fine. We are both able to connect to a server from the server list. I have given him my IP address of 10.0.0.xx:4242 but I get the same socket time out error and my server is listed on the list but has a purple line through it and is under the not compatible and non responsive buttons on the server list that my son can see. I was informed at the steam forums that if you wish to do a local play you don't need the port forwarding and you he should just be able to put my IP into the entry and connect.
    I have tried turning of my firewalls and port forwarding, but for a month I cannot get this working.

    Frustrated.....
    I dont think that steam can do that for starmade. At least that would require the starmade server to run on the steam machine.
    The way you do it, you need to configure the NAT (Network Address Translation) aka Port Forwarding on your router.
    Then your friend has to connect to the public IP of your router, not the LAN IP!
     
    Joined
    Jun 27, 2013
    Messages
    896
    Reaction score
    166
    I dont think that steam can do that for starmade. At least that would require the starmade server to run on the steam machine.
    The way you do it, you need to configure the NAT (Network Address Translation) aka Port Forwarding on your router.
    Then your friend has to connect to the public IP of your router, not the LAN IP!
    They are both in the same room, connected to the same network; there is no need to connect via the public IP, or to use port forwarding.

    In addition to my previous post, if you're already using the 10.x.y.z range, you're fine – that is a private range too. I didn't mention it in the post, but I thought I should make that clear.


    You may need to have two separate installation directories, one for the server, one for the client, if you're running both client and server on the same machine. Simply copy the installation directory to a different name. If you're using desktop shortcuts, make sure you start the client from one directory, and the server from the other.

    Check SERVERDIRECTORY/server.cfg to see if the server is using the whitelist, and if so make sure you are both whitelisted in SERVERDIRECTORY/whitelist.txt.
    The whitelist entries should look like this, of course with the IP addresses you're actually using:
    Code:
    ipt:-1:10.0.0.1
    ipt:-1:10.0.0.2
    In SERVERDIRECTORY/server.cfg, also check to see if you need to authenticate yourselves via the registry; the settings you're looking for are
    Code:
    USE_STARMADE_AUTHENTICATION = false //allow star-made.org authentication
    REQUIRE_STARMADE_AUTHENTICATION = false //require star-made.org authentication 
    MAX_CLIENTS = 4 //Max number of clients allowed on this server, adjust this if necessary
    SERVER_LISTEN_IP = all //Enter specific ip for the server to listen to. use "all" to listen on every ip
    USE_WHITELIST = true //only names/ips from whitelist.txt are allowed
    ANNOUNCE_SERVER_TO_SERVERLIST = false //announces the server to the starmade server list so clients can find it. Hostname must be provided for HOST_NAME_TO_ANNOUNCE_TO_SERVER_LIST!
    You do not want to announce your server to the internet at large unless you know with absolute certainty that you need to, which you don't for your use case.

    If your server is listed as not compatible, check to see whether both of you are in fact using the same version of Starmade. Here's where I can't help you any further, I don't use Steam, and I don't use the launcher; nonetheless the version info should be in a file called version.txt in the same directory that has StarMade.jar and all the config files.
     
    Joined
    Jan 28, 2015
    Messages
    492
    Reaction score
    149
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 3
    These are not internal IP ranges. Do not use these in a local area network.
    I mixed them up error on my part thanks for correcting.

    It is perfectly possible to run client and server on the same machine
    It is possible kind of. But StarMade these days is very resource hungry. So if you have an extra computer to spare then i would use it.

    Steam also gets in the way as it will not let you run two StarMade copies at the same time if you use the New Launcher.

    At least one folder has to be started by the old StarMade Starter as that does not tie in with Steam.

    Use the provided Java that comes bundled with StarMade. With the latest Java 8 I get a lot of runtime exceptions. When the server runs all you see is a white window with in the bottom right corner a button called Shutdown Server. At this point your server is running.

    To have the server use a custom map. Create the map in single player with the copy that runs the server. In my example \StarMadeServer or copy one around from an installation that uses the exact same settings.
     
    Last edited:
    Joined
    Nov 19, 2017
    Messages
    3
    Reaction score
    1
    Thanks guys, lots of help here.

    So I do wish to use my computer, it is considerably more powerful and quick, as the server and run the game if possible at the same time. Then have my son connect to the server I am running.
    A few things...
    1. We both have the same version, (checked version.txt)
    2. I don't need to authenticate starmade, (checked server.cfg)
    3. I am not using a whitelist, (checked)

    So does this mean that if I..
    1. Start a dedicated server for Starmade from another directory, (I just need to copy the folder with the starmade launcher.exe in it)
    2. Start a game from my Steam library and get my son to do the same
    3. Place my son's IP and my IP in the whitelist and change use whitelist to true in server.cfg

    We should be able to play in the same game with just us?

    Thanks in advance guys.... My son and I appreciate the help.
     
    Joined
    Jun 27, 2013
    Messages
    896
    Reaction score
    166
    1. Start a dedicated server for Starmade from another directory, (I just need to copy the folder with the starmade launcher.exe in it)
    You need to find and copy the directory with StarMade.jar in it.
    Assuming you're running Windows, there should also be a file StarMade-dedicated-server-windows.bat in the directory that launches the server.
    Code:
    java -Xms512m -Xmx1024m -Xincgc -Xshare:off -jar StarMade.jar -server
    You may want to adjust -Xmx1024m to some larger value like 2g or 4g, but keep in mind you'll need enough for the client too. You can either click and run the batch file, or enter its contents on a command line; if the latter, make sure you change (cd) to the drive and directory first.


    2. Start a game from my Steam library and get my son to do the same
    3. Place my son's IP and my IP in the whitelist and change use whitelist to true in server.cfg
    It may be worth trying it first without having the whitelist enabled, and only enable it once you've confirmed both of you can connect.
    Whitelisting isn't strictly required if you're not forwarding the port to the internet, but for an additional layer of protection, it wouldn't hurt. Otherwise, the worst thing that can happen is someone uninvited popping on your server and destroying your stuff.

    Another thing you might need to do is add your name(s) to the admin.txt file in the server directory; create and edit it if it isn't there. To the best of my knowledge, it's a simple list of lower case names, one per line. Whoever is listed in there has admin rights and can use all commands. If the file is empty, the first player connecting to the server might be assigned admin, but that's something I never really tried myself, so I can't confirm or deny.
    [doublepost=1511179188,1511178595][/doublepost]
    Use the provided Java that comes bundled with StarMade. With the latest Java 8 I get a lot of runtime exceptions.
    Out of interest, what version is bundled with the launcher? I'm using Java 8.151 on Linux, and I can't confirm "a lot of exceptions" that aren't actual game errors.
     
    Joined
    Jan 28, 2015
    Messages
    492
    Reaction score
    149
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 3
    Out of interest, what version is bundled with the launcher? I'm using Java 8.151 on Linux, and I can't confirm "a lot of exceptions" that aren't actual game errors.
    From my StarMade folder on my Windows 7 computer.

    YourStarMadeFolder\deb\java\jre1.7.0_80

    So that would make it 7.0 release 80.

    Offcourse this is where the funny stuff starts and why trying to do the client and server on one machine is rather tricky.

    On my computer I have the same Java as you Java 8.151. I do not want a global installation of an older version on my computer duh.

    The New Launcher works without Java installed and can call on the bundled 7.0_80 Java to run StarMade.

    The Old StarMade Starter is a Java program in it self and needs Java to run. As far as I know It does not use the bundled Java 7.0_80 that comes with StarMade. So it uses the Java 8.151 installed on the computer.

    When i try to start a server with the use of Java 8.151 then it bombs out right away with a fatal error exception. If I however just launch StarMade as a client to play with Java 8.151 then there are no errors and it runs just fine.

    When I start a server with the use of the New StarMade Launcher and its use of the bundled 7.0_80 then the server runs fine!

    Steam only lets you use one copy of the New StarMade Launcher.

    To then play StarMade on the same machine as where I just made the server. I have to use the StarMade Starter that uses Java 8.151 to run the client. This works but now both installations use another version of Java.

    I can not start the game two times with the StarMade Starter as at least for me the server version refuses to run on Java 8.151.


    Okay writing that down made my head spin have fun reading that a few times. :-p
     

    AndyP

    Customer Experience Manager
    Joined
    Aug 15, 2013
    Messages
    1,199
    Reaction score
    264
    • Schine
    • Wired for Logic
    It would also work, to create a separate installation outside of steam.
    (Or even inside steam without it knowing or caring about.)

    If you fire up the new launcher, you can alter the game installation path:
    launcher2-build-path.png

    If you open that field, containing something like

    C:\users\andy\steam\steamapps\StarMade\StarMade
    you could just append a 2 to the last StarMade, and let the launcher create a separate installation.
    This way, you would ideally use the launcher inside the steamapps directory directly by creating a shortcut to the launcher executable it self,
    then run it with that 2 appended into the dedicated server mode.

    Once you start again with steam, you remove the 2 from the path and return to your regular installation.

    It is like 3 clicks to slightly alter the path to create a new installation.
    Could be way easier than syncing up your system java with the shipped java.

    - Andy
     
    • Like
    Reactions: Batavium
    Joined
    Jan 28, 2015
    Messages
    492
    Reaction score
    149
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 3
    by creating a shortcut to the launcher executable it self
    This was my error. I kept using the New Launcher Desktop Short-cut that Steam had placed there. It never occurred to me that that Short-cut was modified to tie in with Steam.

    I have like 10+ StarMade installations but only used that one default New Launcher Short-cut.

    Very insightful thank you! (y)
     
    Joined
    Nov 19, 2017
    Messages
    3
    Reaction score
    1
    Hi Guys, Thanks a lot. It finally works.
    So here's what I did....
    1. Followed AndyP's idea and launched Starmade from the Steam launcher, but changed the installation directory from E:\Steam\steamapps\xxx\xxx\xxx to E:\Starmade\Starmade and updated. The launcher then downloaded the necessary files. You only need to do this step once.

    2. From the newly created directory, I found the starmade-dedicated-server-windows.bat file and ran it.

    3. Go back to the Steam launcher and change the install directory back to E:\Steam\steamapps\xxx\xxx\xxx and click update. Then clicked launch.

    4. Once in the game go to online play and in the manual server entry typed; localhost:4242, then clicked connect. I was in the game.

    5. On my sons computer, did not do any of the above steps, just launched the game normally through steam and clicked online play and there was my server.....

    HAPPY AS!!!!!!!!

    P.S. I did not have port forwarding open.

    Thank you all for your help and I hope this helps others.
     
    • Like
    Reactions: Batavium