Quick answer: NAT and port-forwarding issues block players from connecting in peer-to-peer multiplayer, because home routers (NATs) don't accept unsolicited inbound connections, so players can't directly reach each other. The wrong fix is asking players to manually port-forward (almost none will). The right fix is automatic NAT traversal (hole punching via STUN-style techniques) with a relay (TURN-style) fallback for the hardest NATs, so connections work behind NATs without any player configuration.
NAT problems are the classic reason peer-to-peer multiplayer 'just won't connect', players behind home routers can't establish a direct connection because of how NAT works. Historically the workaround was telling players to port-forward their routers, but that's a terrible experience almost no one completes. Modern multiplayer solves this automatically with NAT traversal, and understanding it is key to making P2P connectivity actually work.
Why NAT Blocks Connections
NAT (Network Address Translation) lets many devices share one public IP on a home network, but as a side effect, it doesn't allow unsolicited inbound connections, the router doesn't know which internal device an unexpected incoming connection is for, so it drops it. For peer-to-peer multiplayer, this means a player behind a NAT can't simply be connected to directly from the outside; the connection attempt is blocked by their router. When both players are behind NATs (the common case), neither can directly initiate to the other.
Some NATs are more restrictive than others (symmetric NATs are the hardest), and the difficulty of establishing a direct connection depends on the NAT types involved. This is why P2P 'can't connect' problems hit some players and pairings but not others, it depends on their NAT situation. The traditional fix, manual port forwarding, opens a path through the router but requires technical configuration players won't do.
Why Not to Rely on Port Forwarding
Asking players to manually configure port forwarding on their router is not a viable solution for a consumer game. It requires accessing router settings, understanding port forwarding, and configuring it correctly, which the vast majority of players can't or won't do. Relying on it means most players simply can't connect. It also doesn't work in all situations (carrier-grade NAT, etc.). So while port forwarding is mentioned as 'the fix' for NAT issues, it's really a non-solution for reaching a broad audience, the real fix has to be automatic.
The goal is connectivity that works out of the box, behind typical home NATs, with no player configuration, which is what NAT traversal provides.
How to Fix It With NAT Traversal
Implement automatic NAT traversal. Use hole punching (STUN-style): with the help of a coordination server, both peers send packets that 'punch' a path through their NATs, allowing a direct connection to be established without manual port forwarding, this works for most NAT combinations and is the primary fix. For the hardest cases (symmetric NATs, restrictive networks) where hole punching fails, fall back to a relay (TURN-style): the players' traffic is routed through a relay server that both can reach, so they connect indirectly when they can't connect directly. The combination, attempt direct via hole punching, fall back to relay, achieves connectivity for essentially all players automatically.
Many networking libraries and platform services provide NAT traversal and relay so you don't have to build it from scratch. After implementing, verify players connect across various NAT situations without any manual configuration. The principle: connectivity should be automatic and configuration-free, NAT traversal with a relay fallback is how P2P multiplayer connects players behind home routers reliably, replacing the port-forwarding non-solution with something that actually works for everyone.
NAT blocks direct P2P connections, and port-forwarding is a non-solution players won't do. Implement automatic NAT traversal (hole punching) with a relay fallback so connections just work.