Team Fortress 2

Team Fortress 2

325 ratings
Enabling connections to your server [without portforwarding, external programs or websites]
By Thespikedballofdoom
**You don't need to do this anymore. This guide was written for the world before the 2025 SDK update.
sv_use_steam_networking 1 is enabled by default. This console option is the same thing as enabling the checkbox in 'launch server' dialog.**





Because most of you already can do this without this guide, I'm gonna link a guide which is much more useful and written by people with a much more vested interest in server operation and detailed setup, it deals with dedicated servers: Self-hosting your very own TF2 Server





Long story short: Put -enablefakeip in your advanced launch options, then launch a server with sv_lan 0 and look in the console for an IP that you can send to your friends. Basically skipping the port forwarding that is impossible for a lot of people myself included

Everything here works on srcds and client.
11
4
9
2
   
Award
Favorite
Favorited
Unfavorite
Slightly longer version.
Go into your library and right click on TF2











Go to properties and in the first tab general put
-enablefakeip
in the advanced launch options.


Go ahead and launch TF2.

Now launch your server by whatever means you'd like to do that with.
If you use the "launch server" dialog, be warned it will set sv_lan to 1 right before launching the server which will give attempted connections an error, and changing sv_lan back to 0 does not take effect until a map reload. I always launch my server by typing "map mapname" in the console.


Once you're in the game, look in the console again. It should say something like this.



The first map you load when you do this won't have non-default items on because the connection on item servers won't go the first time for some reason. Just start the server again to fix this.
I think this has been fixed, so you don't need to double load. It is only left as this used to happen.

If you're in a real hurry to get your server up with items the fastest way to do it is type "connect d; disconnect; map mapname" or maybe have a config with those commands and just execute it.
All we really need to do for item servers is engage the connection more than once, which this bogus ip does.


Copy the IP after "FakeIP allocation succeeded:" with the port.
Send this IP to whoever you want to connect and they should be able to pop right in.
The command is connect <ip>

Alternatively you could put some unique tag in your sv_tags, and launch your server like that. Tell your friends to type your tag in the server browser tag search bar (it's the wide one on top).

Note that your server will not show up in the server browser until launched for the second time (map mapname will suffice but changelevel will not.) unless you're running the server from SRCDS.

Your friends won't be able to connect off of steam just by right clicking you. I don't know why, it just won't work. I've tried a lot to make it work and it doesn't seem to be possible.
What's going on
All the times you try to connect to your friend's game and it fails after 4 retries is because your router is denying the entry into that port. Probably all ports. What's more, you leak your public IP to the whole internet whenever you host one.

-enablefakeip is a launch option that tells TF2 to use the Steam Datagram Relay (SDR). How it works is as far as I know similar to what a VPN does, and it's more documented on the Steamworks website. It's technically a security measure because of your IP being leaked whenever you host local games and have a steam profile with public game details (that join game button links to your IP, cause that's the IP the server is hosted on.)

The reason it's useful for launching our server is because it bypasses the normal need to port forward our public IP so others can connect. Not our IP, but valve's problem now. And theirs are port forwarded. A lot of us, simply put, are not the administrators of our own network or otherwise not capable of port forwarding. Since the server is running off of your own computer, it can be extensively configured exactly how you want, with sourcemod and whatever.
The launch option was added on the September 16, 2021 Patch
and since the x64 update, SRCDS servers now display in the server browser.

Note that, now that we've opened our server to the public, anyone who has the IP can join, and I have had A LOT OF instances where that means random people surfing the community server browser connected to my server. If you don't want this to happen, you should add hide_server 1 to your autoexec, or +hide_server 1 to your launch options. You could use sv_lan as well but without hide_server your server will still be listed on the master server list.
169 Comments
basiltornado 26 Jul @ 3:26pm 
Looks like sv_use_steam_networking might be set to 0 by default again for my friends and i
that pepsi i owe yah 7 May @ 5:27pm 
make a diddy caked server
-14gb and get sourcemod and metamod - 300mb put them all in tf/addons make the addons file if not existing, put the metamod first then the sourcemod and make sure the sourcemod.zip/metamod/filesformetamod is in metamod and then launch parameter for srcds 32 not 64 most plugins wont work on 64 bit so do that
meth & phetamine 19 Apr @ 8:51pm 
now how do I install plugins
Lord Asshat 5 Mar @ 4:32pm 
No
Egginabox 5 Mar @ 4:18am 
Do i need to do the fakeip thing?
Matthew Gursky 1 Mar @ 12:08pm 
Ok thanks
Thespikedballofdoom  [author] 1 Mar @ 12:01pm 
You don't
Matthew Gursky 1 Mar @ 12:00pm 
so wait. cuz of the new update? will I still have to use the command or no?
Lord Asshat 24 Feb @ 1:27pm 
Oh thank you for mentioning that someone else mentioned it on Reddit and I should have shared it here as well. But yeah that's actually what worked thank you!
Ashref 24 Feb @ 4:13am 
@Lord Asshat try tf_mm_strict 0