Team Fortress 2
Dedicated TF2 Server does not work on localhost despite working on 192.168.x.x and the public ip
Hello to everyone reading this I am having issues with a Dedicated Linux TF2 Server

I cannot connect to it directly via localhost but only through LAN and people can join the public IP and yes I am running it on the same machine as I play TF2

Here is the shell script

#!/bin/sh
cd ~/hlserver/tf2 || exit 1
exec ./srcds_run_64 -debug -console -game tf -autoupdate -steam_dir ~/hlserver/ -steamcmd_script ~/hlserver/tf2_ds.txt +sv_pure 1 +randommap +maxplayers 24 +sv_setsteamaccount (put token here)

I have tried connecting via 127.0.0.1:27015 and it does not work, this has been an issue for days and I cannot think of anything of why it would not work, I can ping 127.0.0.1 and it works with my minecraft server

It also does not display in the community server browser which is probably not related to this but it is extra info

Please help
< >
Showing 1-2 of 2 comments
One theory is that something with the bind syscall doesn't allow special ips like 127.0.0.1 or something like that but I can't confirm that
Perhaps the server doesn't listen on localhost
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Aug 30, 2025 @ 12:26pm
Posts: 2