Left 4 Dead 2

Left 4 Dead 2

View Stats:
JellyDoge Feb 28, 2019 @ 3:57pm
IP issues with L4D2 and SRCDS server hosting
So for the past few days, I've been attempting to set up a dedicated L4D2 server using SteamCMD. I've used SteamCMD before for setting up a few TF2 servers so it wasn't very challenging for me to get the server to a working state. Prepare for a wall of text, it's a long story and I want to provide as many details as possible to figure out what's happening.

However, whenever I launch the server, it uses my local ipv4 instead of my public IP. The exact commands in the console are:

NET_GetBindAddreresses found 192.168.0.2 "Realtek PCIe GBE Family Controller"
Network: IP 192.168.0.2, mode MP, dedicated Yes, ports 27015 SV / 0 CL

From what I've been trying this basically means that the server is lan only and connection with my public IP gets a "connection failed after 10 retries". In case you're wondering, I do have the server set to sv_lan 0 in both my launch parameters and the server.cfg, both of which are here:

-console -game left4dead2 +sv_lan 0 +maxplayers 8 +exec server.cfg +map c2m1_highway +net_public_adr xx.xxx.x.xxx
(The +net_public_adr xx.xxx.x.xxx was a solution suggested on another thread)

https://pastebin.com/u8kss83Z (server.cfg)

Now the real problem, I haven't been using -ip, +host ip, or +port, or their counterpart in the server.cfg because that causes the server to get a:

CreateBoundSocket: ::bind returned error [no name available](10049)

And also an occasional:

\src\common\tcpconnection.cpp (1037) : Assertion Failed: Tried to initiate an outbound connection to 162.254.193.7:27017, bound to local address xx.xxx.x.xxx:26901 (my public IP, the one I set manually, never opened that port though). An ephemeral local port should be used for outbound TCP connections! How does this work?

Along with that, it says in the console that it can't connect to steam servers either. After a while of trying different solutions, I thought it might be fixed if I reinstall the L4D2 dedicated server, I tried this to no avail. I decided to go check on my TF2 server which was set up the exact same way a month prior which worked then to be surprised with the exact same issue I'm having with the L4D2 server. This issue seems to be limited to just SteamCMD servers as all my other servers work just fine.

For just a bit more info on my setup, I have ports 27000 to 27050 open set to BOTH and I'm pretty sure I have a DVW32CB Ubee router if that helps at all. Thanks for the help.

TL;DR: SteamCMD wants to use my local ipv4 instead of my public IP but breaks and won't connect if I manually set it to my public IP.
< >
Showing 1-5 of 5 comments
Blaquicat Feb 28, 2019 @ 6:47pm 
Hello!

First off, i think its unnecessary to set ip on the server, very unlikely anyone will need that, as it is there because some people may have more than one external ip address.
Let the server recognize the ip address itself, even if it gets the wrong ip address(for internal ip), the server should work fine(with the external one)

Mine startup parameters:
setterm -blank 0
./srcds_run -game left4dead2 -maxplayers 12 +sv_lan 0 -port 25594 +sv_gametypes "VERSUS" +map c1m1_hotel -tickrate 125 -frametime 0.037 -frametime_override 0.037 -nomaster
No ip anywhere..
The problem on your case is the connection failled to steam servers, exactly where the server tries to find the current external ip..
hostname: Left 4 Dead 2
version : 2.1.5.3 7291 insecure (secure mode enabled, disconnected from Steam3) (unknown)
udp/ip : 127.0.1.1:25594 [ public n/a ]
os : Linux Dedicated
map : c1m1_hotel
players : 0 humans, 0 bots (12 max) (hibernating) (unreserved)

# userid name uniqueid connected ping loss state rate adr
#end
Connection to Steam servers successful.
VAC secure mode is activated.
status
hostname: Left 4 Dead 2
version : 2.1.5.3 7291 secure (unknown)
udp/ip : 127.0.1.1:25594 [ public 179.216.166.*:25594 ]
os : Linux Dedicated
map : c1m1_hotel
players : 0 humans, 0 bots (12 max) (hibernating) (unreserved)

# userid name uniqueid connected ping loss state rate adr
#end
It only gets the public ip after connecting to steam servers
Note the private ip is wrong, but that does not interfere with anything, i can even connect using the right private ip (192.168.0.5)

The server uses ipv4 because it dont support ipv6 yet.

On your server.cfg you got this line:
sm_cvar mp_gamemode coop

You must take that out, otherwise any game will be coop, even if a versus lobby gets there, the server will change back to coop on any map load.
With some exceptions, its wise to not mess much with 'mp_' cvars.
If you want to start the server as coop default, use the command line parameter, as it is executed only on start.
JellyDoge Mar 1, 2019 @ 1:10pm 
Thanks for the tip about sm_cvar mp_gamemode, I removed that section from my config. My problem however is that once the server connects to the steam servers, it doesn't find my public IP. Here's an example from my TF2 server when it worked:

L 01/28/2019 - 17:26:02: server_cvar: "tf_use_fixed_weaponspreads" "1" L 01/28/2019 - 17:26:02: Connection to Steam servers successful. L 01/28/2019 - 17:26:02: Public IP is xx.xxx.x.xxx. L 01/28/2019 - 17:26:02: Assigned anonymous gameserver Steam ID [A:1:1632920580:11883]. L 01/28/2019 - 17:26:02: VAC secure mode is activated.

Ok, as I was writing this part the issue with my TF2 server seems to have fixed itself but my L4D2 server still fails to connect to my public IP. Here is my most recent server log copied directly from the CMD:

https://pastebin.com/Nfg3pQ2U

So the server doesn't say in the log that it was assigned my public IP and also only shows up in the lan section in the L4D2 server browser. I was able to connect to it from that section but my friend was unable to connect using my public IP. I thought it might have been me connecting with my own public IP from another thread I had read but that wasn't true as I could connect to my TF2 server with my public IP.
One last thing may be that whenever I launch my server, steam says that I have started playing L4D2 from it. Not sure if that helps at all but my TF2 server doesn't have that issue. Thanks for the response though, my inquiry on Alliedmods hasn't been as successful :/
Blaquicat Mar 1, 2019 @ 1:40pm 
L4D2 does not have this:
L 01/28/2019 - 17:26:02: Public IP is xx.xxx.x.xxx.

Type status on the server console and check what ip it has..
hostname: Left 4 Dead 2
version : 2.1.5.3 7291 secure (unknown)
udp/ip : 127.0.1.1:25594 [ public 179.216.166.*:25594 ] <---
os : Linux Dedicated
map : c1m1_hotel
players : 0 humans, 0 bots (12 max) (hibernating) (unreserved)
It only appears after you connect to valve servers..
udp/ip : 127.0.1.1:25594 [ public n/a ]
Last edited by Blaquicat; Mar 1, 2019 @ 1:43pm
JellyDoge Mar 1, 2019 @ 1:59pm 
Dude you are a life saver, that command was what I needed and fixed this. The problem was that since the server tried to run through my steam, I would need to launch my game first. This made the server use the port 27016 which I never even thought of. Thank you so much!
Blaquicat Mar 1, 2019 @ 5:38pm 
Originally posted by JellyDoge:
Dude you are a life saver, that command was what I needed and fixed this. The problem was that since the server tried to run through my steam, I would need to launch my game first. This made the server use the port 27016 which I never even thought of. Thank you so much!
You are welcome..

You can open the server inside a sandbox, this way the steam is unable to detect it.
https://www.sandboxie.com
;)
Last edited by Blaquicat; Mar 1, 2019 @ 5:39pm
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Feb 28, 2019 @ 3:57pm
Posts: 5