I believe it depends on the transports you use. Mostly you don't have to worry about it (unless you're writing a transport module).
WebRTC, for example, does NAT traversal automatically, but it needs a signalling server first. If you use libp2p with the
webrtc-star module it will use a signalling server provided by Protocol Labs, but everything will mostly work, in most of the times.