You are here to host a server, either locally (using the "listen" server) or a dedicated server.
The goal of this document is to explain how to correctly set up your system (and LAN network) so that you may host a server.
The information within this document can be applied to any application or software.
This document assumes you are on a LAN, behind a router (and most likely said router has a built-in firewall).
There are some requirements, please make sure you have them. It will make your life easier.
First off, you'll need to find your router manual. You're going to need your username and password, or at the very least, you need the instructions on how to go about configuring your router.
Once you have your manual (and username and password), you should be able to get into your router's web server, usually by going to a web address such as http://192.168.2.1.
However, routers may vary and as such, the web address for your router may be different - consult your router manual.
You're going to have to "forward" (or "open") a single port to your LAN IP address from your router. In our case, you need to forward port 27015 using the "UDP" protocol (not "TCP").
You may use whatever port you wish, provided it is in the approximate range of 27010 to 27030.
Specific instructions on how to accomplish this can be found in your router manual or by calling your ISP.
Now that your router is allowing data to come in through to the computer you wish to host a server on, you should make sure that all software firewalls (including Windows Firewall) allow data to pass through it to your program (in this case, the server).
For specific instructions on doing this step, refer to the Help menu and files provided by your firewall software.
For Windows Firewall, you need to go into "Control Panel" and then click on "Windows Firewall". The "Windows Firewall" window opens up. Go into the "Exceptions" tab, then click on the "Add Port..." button. Enter "Source Server" for "Name" and enter the port number you chose for "Port number". Make sure you use the "UDP" protocol. Click "OK" and close the "Windows Firewall" window.
So your port is open now. You should be able to host a server now.
Please keep in mind that while in your own LAN, you may not be able to see any servers hosted on said LAN (internet or otherwise), may not be visible to you from the "Internet" tab of the server browser. You may need to get someone outside of your network to check if the server is visible.
If for some reason that person is unable to find your server, try to give that person your WAN IP address; be sure to append the port number to the address if you're not using UDP port 27015. This address can either be obtained from within your router's web server, your ISP, or by visiting a website such as http://www.whatismyip.com.
Have that person try to connect directly to the server through the game by using the "connect" (example: "connect 184.108.40.206:27018") command, using the console.
If he is able to connect, but can't see the server, make sure that your server was able to connect to the Steam servers during start up. You can find out this information by looking in your console (or on the console of your server).