Garry's Mod

Garry's Mod

View Stats:
Phyremaster Jul 25, 2019 @ 8:48pm
[SOLVED] Multiple Dedicated Servers - Only One on Internet Server List
I am trying to host four different Gmod servers on one server computer, and while everything is perfectly functional, only the server that is accessible on the default ports shows up on the "Internet" server list in the Gmod client. They all show up in the history and can be saved as favorites, and they can be connected to with the "connect" command.

I have the UDP ports 27015, 27010, and 27005 and TCP port 27010 forwarded for the first server, and every other server has the same setup, except each port is incremented to one more than the ports for the previous server. The servers are running as Docker containers created from a Docker image that I made (GitHub: https://github.com/Phyremaster/easy-gmod). While the correct ports are redirected to the containers by Docker, all of the servers "think" that they are running on the default ports. If you need to connect to the servers, the address is "phyre.online" (67.174.31.15) and the servers are running on ports 27015 through 27018. Oh, and while I don't remember for certain, I'm pretty sure that I had the same issue when running multiple servers on one computer normally (without Docker).

I've been having a hard time figuring this out, as it seems like every piece of useful information about this specific issue died with the Facepunch forums. Given how many port configurations and whatnot I've tried, there may even be a possibility that this is a bug. If not, then I'm probably missing something that's not documented (SRCDS isn't very well documented, especially for non-Valve games).

TL;DR: I have multiple Gmod SRCDS servers running on one computer, but only one shows up on the public server list.
Last edited by Phyremaster; Aug 1, 2019 @ 5:21pm
< >
Showing 1-7 of 7 comments
smokedope2016 Jul 25, 2019 @ 10:20pm 
you must have different ports per server, you can host multiple servers on one server but they must be seperated with different ports otherwise it'll try to overwrite eachother.
꧁Jay꧂ Jul 26, 2019 @ 1:50am 
Do you have more than one router on your network?
Phyremaster Jul 26, 2019 @ 12:24pm 
I only have one router, the combined modem and router device supplied by my ISP. My server computer is connected by Ethernet to the router's first Ethernet port. The servers ARE on different ports, but only externally; Docker connects the different external ports to the default internal ports (for example, the second SRCDS server has ports 27016, 27011, and 27006 on the host connected to ports 27015, 27010, and 27005 on the server's container).

The SRCDS servers themselves have no way of knowing that they are running on the same computer; they're connected in a virtual network that treats the containers like separate computers. If all of this container stuff sounds confusing, just pretend that I instead have four physically separate servers on the same network and each server is running on the default ports but I redirect them to different external ports in my port forwarding.

Just to be absolutely clear, all four SRCDS servers are fully functional in literally every other aspect; I can connect to all of them, play on all of them without errors, view them in my server history, and add them to my favorite servers. Other people outside of my network get the exact same results as me - everything works, but they're not on the Internet server list. If you want to prove me wrong, search for "Phyre" on the Internet server list under the TTT, Prop Hunt, Murder, and Deathrun gamemodes.
Last edited by Phyremaster; Jul 26, 2019 @ 12:32pm
꧁Jay꧂ Jul 27, 2019 @ 2:34am 
Originally posted by Phyremaster:
I only have one router, the combined modem and router device supplied by my ISP. My server computer is connected by Ethernet to the router's first Ethernet port. The servers ARE on different ports, but only externally; Docker connects the different external ports to the default internal ports (for example, the second SRCDS server has ports 27016, 27011, and 27006 on the host connected to ports 27015, 27010, and 27005 on the server's container).

The SRCDS servers themselves have no way of knowing that they are running on the same computer; they're connected in a virtual network that treats the containers like separate computers. If all of this container stuff sounds confusing, just pretend that I instead have four physically separate servers on the same network and each server is running on the default ports but I redirect them to different external ports in my port forwarding.

Just to be absolutely clear, all four SRCDS servers are fully functional in literally every other aspect; I can connect to all of them, play on all of them without errors, view them in my server history, and add them to my favorite servers. Other people outside of my network get the exact same results as me - everything works, but they're not on the Internet server list. If you want to prove me wrong, search for "Phyre" on the Internet server list under the TTT, Prop Hunt, Murder, and Deathrun gamemodes.
In that case, GMod often doesn't load empty or very low population servers on the server list due to there being too many servers that it'd have to list. Once you get a couple people on it'll show on the server list, if it can't get on the serverlist then it'd also have some VAC errors in the console. If you have to manage the outbound for any reason on your firewall setup then make sure to have TCP/UDP 26901-26999 opened.

I don't have GMod installed I don't think, when I get some free time I can try to find your server on the list.
Phyremaster Jul 27, 2019 @ 11:43am 
Thank you so much, I've been trying to figure this out for weeks. I don't get any VAC errors, and my router's firewall allows all outbound (and so does my OS's firewall, but it's a server OS, so of course it does), so I'm guessing you're right about the lack of players being the problem. I'll get some friends on later to test it to be sure. We've actually had a few players on the TTT server (the one that shows up on the server list), so that would also suggest that you are correct.

Oh, and I almost forgot: do I need to have port 27010 forwarded, or is that just a security risk?
Last edited by Phyremaster; Jul 27, 2019 @ 11:44am
꧁Jay꧂ Jul 27, 2019 @ 3:48pm 
Originally posted by Phyremaster:
Thank you so much, I've been trying to figure this out for weeks. I don't get any VAC errors, and my router's firewall allows all outbound (and so does my OS's firewall, but it's a server OS, so of course it does), so I'm guessing you're right about the lack of players being the problem. I'll get some friends on later to test it to be sure. We've actually had a few players on the TTT server (the one that shows up on the server list), so that would also suggest that you are correct.

Oh, and I almost forgot: do I need to have port 27010 forwarded, or is that just a security risk?
27010 isn't needed, and you're welcome I hope that ends up being the case
Phyremaster Aug 1, 2019 @ 5:19pm 
Alright, so while your answer was very helpful and may solve similar issues for other people, it turns out that this did not solve my issue. I did manage to solve the issue, though. I'll explain how:

So, as I mentioned previously, my servers are running in Docker containers, and they were all running on the default ports, which were then redirected to separate ports by Docker. While that setup works (as in all servers can be connected to and used normally), it prevents them from appearing on the "Internet" server list. The solution, then, was to change my configuration so that all of the servers ran on the same ports as they were actually exposed on, rather than redirecting the ports with Docker.

I don't know exactly why this happens, but I have a pretty good guess. The "Internet" server list in Gmod is pulled from a master server that maintains a list of all currently active servers. The master server has to get the IP address and port that a server is running on to list it. If the master server figured this out automatically by testing which port(s) on a computer connect to (a) SRCDS server(s), I would never have had any issues. That isn't how it works, though; instead, I believe that the server(s) send(s) IP address and port information to the master server. Why is that a problem for my servers? All of my servers "thought" they were running on the default ports, because I redirected them to different ports in Docker without "telling" them. Assuming my guess as to how the server list works is correct, all four of my servers were then "telling" the master server that they were on the default ports. Of course, when the master server actually connects to the default ports, it can only find one server, so it only lists that server.

Again, I really appreciate your help, and you were correct about the basics, including which ports matter (27015 and 27005, but not 27010).

TL;DR: It turns out that the server list requires that Gmod servers run on the ports that they are actually exposed on, even though redirecting works for everything else. This means that the real solution (for me) was to not redirect ports and instead just run the servers on the ports that they are exposed on.

(P.S.: If this sounds obvious to you, then you don't understand how Docker works.)
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Jul 25, 2019 @ 8:48pm
Posts: 7