I bought the game on Switch 2 and, for the past few days, I've been trying to play with a friend on PC.
However, when I joined his world (or vice versa), an Ethernet error symbol would start flashing in the top-left corner, and within 30 seconds, whoever joined the world would be disconnected.
We tried everything, including changing Wi-Fi networks, using a wired cable, hosting a server, and messing with port forwarding, without finding anything useful online, even though others were experiencing the exact same issue.
Then, I finally found a solution that worked for me, it appears to be the MTU default limit, but here is what I followed:
"On your Switch 2, go to: System Settings > Internet > Internet Settings.
Select your connection and tap Change Settings
Set DNS Settings to Manual:
Primary DNS: 1.1.1.1 (Cloudflare)
Secondary DNS: 8.8.8.8 (Google)
Set MTU to 1500.
Save the settings."
Credits to nallovint from discord.
Source: r/valheim · by /u/DovahGrohiik