Opening and forwarding the correct ports allows your Left 4 Dead 2 dedicated server to accept incoming connections from players over the internet, enabling multiplayer gameplay. This process ensures that traffic on the required UDP and TCP ports reaches your server machine through your router’s firewall and NAT.

What You'll Need

  • A computer running the Left 4 Dead 2 dedicated server software (Windows or Linux)
  • Access to your router’s administration interface (typically via a web browser at 192.168.1.1 or similar)
  • The local IP address of the machine hosting the server
  • Administrator or root privileges on the server machine to configure firewall rules
  • Basic knowledge of port forwarding and firewall concepts

Step-by-Step

  1. Determine the local IP address of your server machine. On Windows, open Command Prompt and type ipconfig, then note the IPv4 address under your active network adapter (e.g., 192.168.1.100). On Linux, use hostname -I or ip addr show.
  2. Access your router’s admin panel by entering its gateway IP (found via ipconfig or route -n) into a web browser. Log in with your administrator credentials.
  3. Locate the port forwarding or virtual server section. This is commonly found under Advanced > NAT Forwarding, Port Forwarding, or Applications & Gaming, depending on the router brand (e.g., Netgear, TP-Link, Asus).
  4. Create a new port forwarding rule for UDP port 27015. Set the service name to "L4D2 Server", the external port to 27015, the internal port to 27015, and the internal IP address to your server’s local IP (e.g., 192.168.1.100). Select UDP as the protocol.
  5. Create a second rule for TCP port 27015 using the same internal IP and ports, but select TCP as the protocol. Some server functions, such as Steam authentication and server listing, rely on TCP.
  6. Optional but recommended: Forward UDP port 27005 for Steam client communication and UDP port 27020 for Steamworks networking if you plan to use lobby features or peer-to-peer elements. These are less critical for basic dedicated server operation but improve reliability.
  7. Save the port forwarding rules and apply the changes. Your router may reboot or reload the NAT table.
  8. Configure the firewall on your server machine to allow incoming traffic on the forwarded ports. On Windows Firewall, go to Control Panel > System and Security > Windows Defender Firewall > Advanced Settings > Inbound Rules > New Rule. Select Port, specify UDP 27015 and TCP 27015, allow the connection, apply to all profiles (Domain, Private, Public), and name the rule "L4D2 Server". Repeat for any additional ports like 27005 or 27020 if forwarded.
  9. On Linux, if using UFW, run sudo ufw allow 27015/udp and sudo ufw allow 27015/tcp. For firewalld, use sudo firewall-cmd --permanent --add-port=27015/udp and sudo firewall-cmd --permanent --add-port=27015/tcp, then reload with sudo firewall-cmd --reload. Adjust for additional ports as needed.
  10. Start your Left 4 Dead 2 dedicated server using the appropriate launch command (e.g., srcds.exe -game left4dead2 -console -port 27015 +map c1m1_hotel +maxplayers 4 on Windows or ./srcds_run -game left4dead2 -console -port 27015 +map c1m1_hotel +maxplayers 4 on Linux). Ensure the server binds to port 27015.
  11. Verify the server is accessible externally. Have a friend attempt to join using your public IP address (found via sites like whatismyip.com) followed by :27015 (e.g., 203.0.113.1:27015). Alternatively, use a port checking tool like canyouseeme.org to test if UDP 27015 is open from the internet.
  12. If the server does not appear in the public server list, confirm that your server is configured to announce to the master server. In your server launch parameters, ensure -secure is present (for VAC) and that +sv_lan 0 is set to disable LAN-only mode.

Common Mistakes

  • Forwarding only TCP or only UDP for port 27015 — both protocols are required for full functionality.
  • Using the public IP address in the router’s internal IP field instead of the server’s local IP.
  • Forgetting to apply or save changes in the router admin panel after creating rules.
  • Overlooking the server machine’s local firewall, which blocks incoming connections even if the router forwards correctly.
  • Confusing the server port (27015) with Steam’s client ports (like 27036 for updates) and forwarding the wrong numbers.
  • Running the server in LAN mode (sv_lan 1) which prevents internet advertising and blocks non-local connections.
  • Assuming that enabling UPnP or NAT-PMP eliminates the need for manual forwarding — these may not work reliably with dedicated servers.

Tips

  • Assign a static IP address to your server machine via your router’s DHCP reservation feature to avoid losing port forwarding after a reboot.
  • Test connectivity using both UDP and TCP checks; tools like nmap -sU -p 27015 and nmap -sT -p 27015 can verify openness from another network.
  • Monitor server logs for messages like "Server public address is" or "Failed to bind to port" to diagnose binding or forwarding issues early.
  • If you host multiple servers on the same network, increment the port for each (e.g., 27015, 27016, 27017) and forward accordingly, adjusting -port in the launch command.
  • Consider using a wired Ethernet connection for the server host to reduce latency and packet loss compared to Wi-Fi.
  • Keep the server and SteamCMD updated to ensure compatibility with the latest master server protocols.

Troubleshooting

  • If players cannot connect, first restart the router and server machine to clear any stale NAT or firewall states.
  • Double-check that the server is actually listening on port 27015. On Windows, use netstat -ano | findstr :27015; on Linux, use ss -uln | grep :27015 or netstat -anu | grep :27015. Look for a UDP state.
  • Verify that the router’s WAN IP is not a private or CGNAT address (e.g., 100.64.x.x, 10.x.x.x, 192.168.x.x). If it is, you are behind a carrier-grade NAT and cannot port forward — contact your ISP for a public IP or use a VPN tunnel service.
  • Temporarily disable the server machine’s firewall to test if it’s blocking traffic. If connections work, re-enable and fix the rule. Never leave the firewall disabled permanently.
  • Check the router’s system logs for dropped packets or blocked port attempts, which may indicate misconfigured rules or ISP-level blocking.
  • Ensure no other application (e.g., another game server, P2P software) is already using port 27015 on the server host, causing a bind conflict.
  • If using a VPN or proxy service on the server host, ensure it’s not redirecting or blocking outgoing announcements to the Steam master server.
  • As a last resort, connect the server machine directly to the modem (bypassing the router) to test if the issue is router-related. If it works, the problem is definitely in the router configuration.

Frequently Asked Questions

Do I need to forward ports for a Left 4 Dead 2 listen server?

A listen server (hosted from within the game client) typically uses the same ports (27015 UDP/TCP) and may require forwarding if players are connecting over the internet, though NAT punchthrough via Steam sometimes works without manual forwarding.

Can I use a different port than 27015 for my L4D2 server?

Yes, you can specify an alternative port using +port 27016 or similar in the launch command, but you must forward that exact port instead — both UDP and TCP — and ensure no conflicts with other services.

Why does my server show as offline in the server browser even after forwarding?

This often occurs if sv_lan 1 is set (forcing LAN mode), the server isn’t announcing to the master server due to missing -secure or network issues, or the server heartbeat is blocked by a firewall.

Is it safe to open these ports on my router?

Opening ports 27015 UDP/TCP for a dedicated game server is generally safe, as the traffic is limited to the Source engine protocol. However, always keep your server and host system updated to mitigate potential vulnerabilities.