Network Address Translation (NAT) replaces IP addresses within a packet with different IP addresses. NAT is useful for conserving IP addresses and connecting a private network using unregistered addresses to a public network such as the Internet.
Voice over IP (VoIP) is a technology that enables voice communication between devices over an IP network. The conventional phones, fax machines, and PBX connect to a voice gateway, which has analog ports for connecting these devices. VoIP also connects to an IP network used for carrying data. The voice gateway translates the information between the legacy voice network and the data network by carrying voice information within IP packets in the form of data. VoIP uses User Datagram Protocol (UDP) at the transport layer and uses various protocols like H.323, Media Gateway Control Protocol (MGCP), Session Initiation Protocol (SIP), Skinny Client Control Protocol (SCCP), Real-Time Transport Protocol (RTP), and RTP Control Protocol (RTCP) above the transport layer.
VoIP protocols use dynamic port numbers that are negotiated while establishing a call. The port numbers and addresses are exchanged during the negotiation phase in the IP packet payload. This presents a challenge when configured along with NAT because NAT normally looks only at the IP header to do the translation.
Cisco IOS Software has been enhanced with the Application Layer Gateway (ALG) feature, which is intelligent enough to automatically scan the addresses and port numbers carried in the payload of these protocols. This feature allows VoIP to work across a NAT router by setting up translations for the negotiated parameters.
For more information on how VoIP signaling works, challenges of NAT, and software versions that support the ALG feature for various VoIP protocols, refer to the below documents. Other methods that use VoIP to traverse NAT are included as well.