Dedicated Server Nightmare

Hoping someone can help - I've spent hours on Reddit and reading here trying to figure out how to get a dedicated server working for this game. Let it be known that I have a long history of hosting dedicated servers for L4D, KF/KF2, etc and know my way around this stuff for the most part. My friend and I have both been trying to get a server up with no luck at all. Here's what I have so far:

Ports 2456 through 2458 TCP and UDP ports open and forwarded on my router and Incoming/Outgoing rules have been created for both TCP and UDP in Windows Firewall.

Current startup string: valheim_server.exe -nographics -batchmode -name "NAME" -port 2456 -world "WORLD" -password "PASSWORD" -public 1

Neither of our servers ever show up in the public list. We can both join our own servers by joining localhost:2456 but cannot join each other's server. We just get the spinning symbol followed by "Failed to Connect" every time we try. We're on the verge of giving up at this point.
12:13 am, December 28, 2021
PJthePlayer 0 comments 0 likes

Lecherous Lychee 🐸 replied to Dedicated Server Nightmare December 27, 2021 @ 4:48:54 pm PST

Originally posted by PJthePlayer:
Originally posted by Lecherous Lychee 🐸:
Can your friend join your dedicated server directly using: 123.123.123.123:2457 and vice versa?

"123.123.123,123" being your external IP address.

Can confirm that this doesn't work in either direction (me to his server, him to mine)

I noticed that the port is kind of different for some people. For example, in the guides, most people connect with externalIP:2456 - but this doesn't work for our server, even though we opened up 2456, 2457, and 2458 TCP/UDP. externalIP:2457 works instead.

For example, this is in my start.bat:

@echo off
set SteamAppId=892970

echo "Starting server PRESS CTRL-C to exit"

valheim_server -nographics -batchmode -name "SERVERNAME" -port 2457 -world "NAME" -password "YOURPASSWORD"
3:13 am, December 28, 2021
0 comments 0 likes

lexx000 replied to Dedicated Server Nightmare December 27, 2021 @ 5:06:55 pm PST

Originally posted by PJthePlayer:
Originally posted by lexx000:
By any chance, are you using a modem / router provided by your ISP? I have noticed that with some of the HITRON cable modems, you can end up in a situation where you are "double NAT'ED".

On my setup, I have Ports 2456-2458 TCP and UDP forwarded to a specific IP (the machine running the dedicated server - which is distinct from my gaming PC).

Try this tool -> https://www.ipfingerprints.com/portscan.php - select Advanced - Ping Type "
Don't Ping" - General Options- UDP Scan.

You should see output similar to mine:
Host is up.

PORT STATE SERVICE

2456/tcp filtered altav-remmgt

2457/tcp filtered rapido-ip

2458/tcp filtered griffin

2456/udp open|filtered altav-remmgt

2457/udp open|filtered rapido-ip

2458/udp open|filtered griffin

If you don't see this, and you have a modem provided by your ISP AND a separate router, I suspect you are double NAT'ed.

I'd confirm that settings like "Residential Gateway Function" is set to enabled, consider enabling uPNP which will allow the other router to open the port on the ISP modem.

Hopefully some of this stuff helps - I know that with older games like UT3 for example, the type of NAT that I had "symmetrical" vs. "full-cone" made a difference, but I hope it's not the case here.

NOTE - none of this is based on using the same PC that you game on as the dedicated server, I would refer to guidance elsewhere for that - my setup is based on a dedicated machine running the game. If you want to try one more option, consider running it in a VM to see if this helps, because to me it's still sounds like NAT or Firewall.

Hope this helps!


Wow, thanks for this detailed response. I can confirm I am using an ARRIS modem provided by Spectrum but my friend is on AT&T (not sure if he is using an ISP-provided modem or not).

I ran the tool you sent and got the following results:

PORT STATE SERVICE

2456/tcp filtered altav-remmgt

2457/tcp filtered rapido-ip

2458/tcp closed griffin

2456/udp open|filtered altav-remmgt

2457/udp open|filtered rapido-ip

2458/udp closed griffin

I am confused by this result - my modem is attached to a Google Wifi network and the Google Wifi primary router handles all port forwarding, etc. It has a rule set to open and forward 2456 through 2458 to the PC that is running the server instance. Disabling Windows Firewall doesn't affect the results either - could this be ISP-based port blocking?

You're welcome - hmm, what I find odd is that both your Port 2458 on TCP and UDP are closed. Can you try something? try increasing the range to Port 2459 for both TCP and UDP.

I would expect the ports to be filtered for TCP and Open|Filtered for UDP.

Assuming you are not running any other services / servers? E.g. do you have a second Valheim server? One thing I learned in my setup, is that if I wanted people to connect to my second Valheim server - I had to run it from Port 2466 and had Port Forwarding range set to Port 2466-2468 for TCP/UDP.

Is this on Windows? (I forget if there is a Dedicated Server for Linux :o) )

I also saw your other reply about your friend who has similar results to mine.

I am starting to think that if you are on Windows, then this is a Windows Firewall setting.

On my Windows Dedicated Server - what I have done the following:
1. "search for Firewall"
2. Once you are at the page with "Help protect your PC with Windows Defender Firewall"
3. Click on Advanced Settings (may have a UAC shield on it)
4. Navigate to "Inbound Rules"
5. Create a new rule on the right pane.
6. Select the radio button for "Program", click Next
7. Under this Program Path - navigate to where your Valheim dedicated server file is - in my case it says: "D:\SERVERS\ValheimDS\valheim_server.exe"
8. click next
9. In the "what action should be taken when a connection matches the specified conditions?" window - select "Allow the Connection" radio button
10. When does this rule apply - select all your networks (in my case I have Domain, Private, Public
11. Give it a name and a description
12. Click Next / Apply.
13. Find your new Valheim Dedicated Server rule under Inbound Rules
14. Double left click it to open it up.
15. Under "Programs and Services" ensure the correct EXE is under the "This Program" radio button - don't change anything else
16. Under "Protocols and Ports" - leave it "Protocol type = Any", "Local Port: All Ports", "Remote Port: All Ports"
17. Under Scope: Any IP Address for local and remote IP
18. Under Advanced: for Profiles it should be Domain, Private, Public ; Interface types: Make sure "All Interface Types" radio is selected ; Edge Traversal - "Block Edge Traversal" is what you should have there.
19. Click OK and that window should close.
20. Restart your Valheim dedicated server.

I'm assuming you know this, but when you run Valheim Dedicated Server - you need to ensure you shut it down with CTRL-C until you see a message with a Y/N window prompt that you have to action with "Y". After making those changes above, reboot, just to ensure nothing is running and launch the dedicated server again.

I still think that based on the port scan you might want to try increasing the TCP/UDP port forward range from 2456-2459 just to ensure you can get the same port results as I have.

For your friend, I suspect it's the Windows Inbound rules - this is one dedicated server EXE that I never recall raising a Windows Firewall prompt on launch.

Hope all this works! Let me know how it goes. Cheers - Lexx
3:13 am, December 28, 2021
0 comments 0 likes

PJthePlayer replied to Dedicated Server Nightmare December 27, 2021 @ 1:28:51 pm PST

Also some further info: We have both tried disabling our firewalls entirely with no luck. We have also tried running the server in an elevated command prompt but that makes no difference. We're also on different ISPs which seems to rule out an ISP-specific issue.
12:13 am, December 28, 2021
0 comments 0 likes

Lecherous Lychee 🐸 replied to Dedicated Server Nightmare December 27, 2021 @ 2:27:26 pm PST

Can your friend join your dedicated server directly using: 123.123.123.123:2457 and vice versa?

"123.123.123,123" being your external IP address.
12:13 am, December 28, 2021
0 comments 0 likes

lexx000 replied to Dedicated Server Nightmare December 27, 2021 @ 2:32:36 pm PST

By any chance, are you using a modem / router provided by your ISP? I have noticed that with some of the HITRON cable modems, you can end up in a situation where you are "double NAT'ED".

On my setup, I have Ports 2456-2458 TCP and UDP forwarded to a specific IP (the machine running the dedicated server - which is distinct from my gaming PC).

Try this tool -> https://www.ipfingerprints.com/portscan.php - select Advanced - Ping Type "
Don't Ping" - General Options- UDP Scan.

You should see output similar to mine:
Host is up.

PORT STATE SERVICE

2456/tcp filtered altav-remmgt

2457/tcp filtered rapido-ip

2458/tcp filtered griffin

2456/udp open|filtered altav-remmgt

2457/udp open|filtered rapido-ip

2458/udp open|filtered griffin

If you don't see this, and you have a modem provided by your ISP AND a separate router, I suspect you are double NAT'ed.

I'd confirm that settings like "Residential Gateway Function" is set to enabled, consider enabling uPNP which will allow the other router to open the port on the ISP modem.

Hopefully some of this stuff helps - I know that with older games like UT3 for example, the type of NAT that I had "symmetrical" vs. "full-cone" made a difference, but I hope it's not the case here.

NOTE - none of this is based on using the same PC that you game on as the dedicated server, I would refer to guidance elsewhere for that - my setup is based on a dedicated machine running the game. If you want to try one more option, consider running it in a VM to see if this helps, because to me it's still sounds like NAT or Firewall.

Hope this helps!
12:13 am, December 28, 2021
0 comments 0 likes

Ryzilynt replied to Dedicated Server Nightmare December 27, 2021 @ 2:35:08 pm PST

I forget how to get it to appear on the server list, but I know you should be able to connect directly using IP ;port. I use a gportal server now, but my friend originally set it up on a spare box using this guide :

https://www.pcgamer.com/valheim-multiplayer-dedicated-server/
12:13 am, December 28, 2021
0 comments 0 likes

PJthePlayer replied to Dedicated Server Nightmare December 27, 2021 @ 3:01:30 pm PST

Originally posted by Lecherous Lychee 🐸:
Can your friend join your dedicated server directly using: 123.123.123.123:2457 and vice versa?

"123.123.123,123" being your external IP address.

Can confirm that this doesn't work in either direction (me to his server, him to mine)
12:13 am, December 28, 2021
0 comments 0 likes

PJthePlayer replied to Dedicated Server Nightmare December 27, 2021 @ 3:05:08 pm PST

Originally posted by lexx000:
By any chance, are you using a modem / router provided by your ISP? I have noticed that with some of the HITRON cable modems, you can end up in a situation where you are "double NAT'ED".

On my setup, I have Ports 2456-2458 TCP and UDP forwarded to a specific IP (the machine running the dedicated server - which is distinct from my gaming PC).

Try this tool -> https://www.ipfingerprints.com/portscan.php - select Advanced - Ping Type "
Don't Ping" - General Options- UDP Scan.

You should see output similar to mine:
Host is up.

PORT STATE SERVICE

2456/tcp filtered altav-remmgt

2457/tcp filtered rapido-ip

2458/tcp filtered griffin

2456/udp open|filtered altav-remmgt

2457/udp open|filtered rapido-ip

2458/udp open|filtered griffin

If you don't see this, and you have a modem provided by your ISP AND a separate router, I suspect you are double NAT'ed.

I'd confirm that settings like "Residential Gateway Function" is set to enabled, consider enabling uPNP which will allow the other router to open the port on the ISP modem.

Hopefully some of this stuff helps - I know that with older games like UT3 for example, the type of NAT that I had "symmetrical" vs. "full-cone" made a difference, but I hope it's not the case here.

NOTE - none of this is based on using the same PC that you game on as the dedicated server, I would refer to guidance elsewhere for that - my setup is based on a dedicated machine running the game. If you want to try one more option, consider running it in a VM to see if this helps, because to me it's still sounds like NAT or Firewall.

Hope this helps!


Wow, thanks for this detailed response. I can confirm I am using an ARRIS modem provided by Spectrum but my friend is on AT&T (not sure if he is using an ISP-provided modem or not).

I ran the tool you sent and got the following results:

PORT STATE SERVICE

2456/tcp filtered altav-remmgt

2457/tcp filtered rapido-ip

2458/tcp closed griffin

2456/udp open|filtered altav-remmgt

2457/udp open|filtered rapido-ip

2458/udp closed griffin

I am confused by this result - my modem is attached to a Google Wifi network and the Google Wifi primary router handles all port forwarding, etc. It has a rule set to open and forward 2456 through 2458 to the PC that is running the server instance. Disabling Windows Firewall doesn't affect the results either - could this be ISP-based port blocking?
12:13 am, December 28, 2021
0 comments 0 likes

PJthePlayer replied to Dedicated Server Nightmare December 27, 2021 @ 3:05:33 pm PST

Originally posted by Ryzilynt:
I forget how to get it to appear on the server list, but I know you should be able to connect directly using IP ;port. I use a gportal server now, but my friend originally set it up on a spare box using this guide :

https://www.pcgamer.com/valheim-multiplayer-dedicated-server/

Ironically I was following the same guide. We're unable to connect even directly by IP.
12:13 am, December 28, 2021
0 comments 0 likes

Ryzilynt replied to Dedicated Server Nightmare December 27, 2021 @ 3:06:40 pm PST

Can you guys join your own server? If yes, if you are friends in steam what happens when you try to use the "join game" feature in steam i.e. from the friends menu
12:13 am, December 28, 2021
0 comments 0 likes

PJthePlayer replied to Dedicated Server Nightmare December 27, 2021 @ 3:08:15 pm PST

Originally posted by Ryzilynt:
Can you guys join your own server? If yes, if you are friends in steam what happens when you try to use the "join game" feature in steam i.e. from the friends menu

We can join our own servers by joining localhost:2456 but when you do that the "join game" feature is not available.
12:13 am, December 28, 2021
0 comments 0 likes

Ryzilynt replied to Dedicated Server Nightmare December 27, 2021 @ 3:10:36 pm PST

I'm out of ideas, sorry. Push comes to shove, gportal is super easy to set up, just need to pay $45 for 3 months and they give you the IP.
12:13 am, December 28, 2021
0 comments 0 likes

PJthePlayer replied to Dedicated Server Nightmare December 27, 2021 @ 3:16:29 pm PST

Originally posted by lexx000:
By any chance, are you using a modem / router provided by your ISP? I have noticed that with some of the HITRON cable modems, you can end up in a situation where you are "double NAT'ED".

On my setup, I have Ports 2456-2458 TCP and UDP forwarded to a specific IP (the machine running the dedicated server - which is distinct from my gaming PC).

Try this tool -> https://www.ipfingerprints.com/portscan.php - select Advanced - Ping Type "
Don't Ping" - General Options- UDP Scan.

You should see output similar to mine:
Host is up.

PORT STATE SERVICE

2456/tcp filtered altav-remmgt

2457/tcp filtered rapido-ip

2458/tcp filtered griffin

2456/udp open|filtered altav-remmgt

2457/udp open|filtered rapido-ip

2458/udp open|filtered griffin

If you don't see this, and you have a modem provided by your ISP AND a separate router, I suspect you are double NAT'ed.

I'd confirm that settings like "Residential Gateway Function" is set to enabled, consider enabling uPNP which will allow the other router to open the port on the ISP modem.

Hopefully some of this stuff helps - I know that with older games like UT3 for example, the type of NAT that I had "symmetrical" vs. "full-cone" made a difference, but I hope it's not the case here.

NOTE - none of this is based on using the same PC that you game on as the dedicated server, I would refer to guidance elsewhere for that - my setup is based on a dedicated machine running the game. If you want to try one more option, consider running it in a VM to see if this helps, because to me it's still sounds like NAT or Firewall.

Hope this helps!

Had my buddy run that tool and he actually gets identical results to you so I'd think his would be working, but sadly not.
12:13 am, December 28, 2021
0 comments 0 likes

TheTeemo******* replied to Dedicated Server Nightmare December 27, 2021 @ 3:21:52 pm PST

When its up and running can i play lol?
12:13 am, December 28, 2021
0 comments 0 likes

Mharr replied to Dedicated Server Nightmare December 27, 2021 @ 3:54:26 pm PST

This sounds like it might be a job for a virtual LAN
12:13 am, December 28, 2021
0 comments 0 likes