How to Port Forward a FiveM Server: TCP & UDP Guide
Port forwarding for a FiveM server lets outside players connect to your game by opening specific ports on your router. This guide walks you through finding your router’s IP, setting a static IP for your PC, and forwarding the required TCP and UDP ports, plus fixes for common issues.
What You’ll Need
- Access to your router’s admin panel (usually via a web browser).
- Your computer’s local IP address (e.g., 192.168.1.10).
- The router’s public IP address (to share with players).
- Your FiveM server’s default port (usually 30120).
Step-by-Step
- Find your router’s IP address. On Windows, open Command Prompt and type
ipconfig. Look for the “Default Gateway” under your active network adapter (e.g., 192.168.1.1). On macOS, go to System Settings > Network > your connection > Details, and find the Router address. - Log into your router. Open a web browser and type the router’s IP into the address bar. Enter your router’s username and password (often printed on the router or in its manual). If you don’t know them, try common defaults like “admin” for both.
- Set a static IP for your PC. This prevents your computer’s IP from changing, which would break the port forward. In your router’s settings, look for “DHCP Reservation” or “Static IP.” Add your PC’s MAC address (found in
ipconfig /allon Windows or System Settings > Network > Details on macOS) and assign it a fixed IP, like 192.168.1.50. Alternatively, set a static IP in your operating system’s network settings. - Locate the port forwarding section. In your router’s admin panel, find “Port Forwarding,” “Virtual Server,” or “NAT.” This is usually under “Advanced” or “Security” tabs.
- Create a new port forward rule. Click “Add” or “Create New.” You’ll need to enter:
- Service Name: e.g., “FiveM-TCP”
- Protocol: TCP (for the TCP rule) or UDP (for the UDP rule).
- External Port: 30120 (or your custom port).
- Internal Port: 30120 (same as external unless you’re using a different internal port).
- Internal IP: The static IP you set for your PC (e.g., 192.168.1.50).
- Add both TCP and UDP rules. FiveM uses both protocols. Create two separate rules: one for TCP 30120 and one for UDP 30120. Some routers allow a “Both” option, but if not, create two.
- Save and apply the changes. Click “Save” or “Apply” on each rule. The router may reboot.
- Test the port forward. Use an online port checker (like canyouseeme.org) to verify that port 30120 is open. Enter your public IP (find it by searching “what’s my IP” on Google) and the port. If it says “Success,” your forward works.
- Start your FiveM server. Launch your server and have a friend try to connect using your public IP and port, like
http://your-public-ip:30120. If they can connect, you’re done.
Common Mistakes
- Using the wrong IP. Make sure the internal IP in the port forward matches your PC’s current IP exactly. If your PC’s IP changed, the forward won’t work.
- Forgetting to set a static IP. Without a static IP, your PC may get a new IP after a reboot, breaking the forward.
- Only forwarding TCP or UDP. FiveM needs both. Double-check that both rules exist.
- Firewall blocking the port. Windows Defender Firewall or third-party firewalls can block incoming connections even with port forwarding. Add an inbound rule for TCP and UDP port 30120.
- Using the wrong port. If you changed the server’s port in your server.cfg, you must forward that port, not the default 30120.
Tips
- Use a static IP for your server PC to avoid reconfiguring the forward every time.
- Keep a note of your router’s model and firmware version; port forwarding menus vary widely.
- If your router has a “UPnP” option, you can enable it, but it’s less secure and may not work with all games. Manual forwarding is more reliable.
- For multiple servers, use different ports (e.g., 30121, 30122) and forward each one.
- Share your public IP with players, but be aware that it can change if your ISP assigns dynamic IPs. Consider using a dynamic DNS service.
Troubleshooting
Port checker says closed: First, verify your server is running. If it is, check that the internal IP is correct and that your PC’s firewall isn’t blocking. Try temporarily disabling the firewall to test. If it works with the firewall off, add an exception for the FiveM server executable and port.
Players can’t connect even though the port is open: Ensure your server.cfg has the correct endpoint_add_tcp and endpoint_add_udp lines. These should point to your public IP and port, or use 0.0.0.0 to listen on all interfaces. Also, check that your server is actually listening on that port by looking at the server console.
Router shows the forward but it still fails: Some ISPs use Carrier-Grade NAT (CGNAT), which means your public IP isn’t directly reachable. Contact your ISP to confirm. If you have CGNAT, you may need to request a public IP or use a VPN service.
After a router reboot, the forward disappears: Some routers reset settings after a reboot. Re-apply the rules. To avoid this, save a backup of your router config.
Frequently Asked Questions
What ports does FiveM use?
FiveM uses TCP and UDP on port 30120 by default. You can change this in your server.cfg, but you must forward the new port.
Do I need to forward both TCP and UDP?
Yes, FiveM uses both protocols for different functions. Forwarding only one can cause connection issues.
Can I use the same port for multiple servers?
No, each server needs a unique port. You can set different ports in each server’s config and forward each one.
How do I find my public IP?
Search “what’s my IP” on Google or visit a site like whatismyip.com. This is the IP players will use to connect.
What if my router doesn’t have a port forwarding option?
Some ISP-provided routers may lack this feature. You can try enabling UPnP, or contact your ISP for support. Alternatively, use a router that supports port forwarding.
Is port forwarding safe?
Port forwarding exposes that port to the internet, which can be a security risk if the service has vulnerabilities. Keep your server software updated and consider using a firewall.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.