The AutoNATv2 service implements the AutoNAT v2 protocol to confirm whether addresses the node is listening on are dialable by remote peers.
It does not implement NAT hole punching.
import { createLibp2p } from 'libp2p'import { autoNATv2 } from '@libp2p/autonat-v2'const node = await createLibp2p({ // ...other options services: { autoNAT: autoNATv2() }}) Copy
import { createLibp2p } from 'libp2p'import { autoNATv2 } from '@libp2p/autonat-v2'const node = await createLibp2p({ // ...other options services: { autoNAT: autoNATv2() }})
The AutoNATv2 service implements the AutoNAT v2 protocol to confirm whether addresses the node is listening on are dialable by remote peers.
It does not implement NAT hole punching.
Example