# List of STUN servers

> Why WebRTC needs a STUN server when the PBX is behind NAT, how to configure one in Asterisk, and a list of public STUN servers.

URL: https://webrtcclient.com/guides/stun-servers/

To receive audio when your phone system is behind NAT, you will most likely need a STUN server. The PBX asks the STUN server for its public IP address and port, and uses that information in the media negotiation (ICE) so that the browser can send audio to the right address.

## Configuring STUN in Asterisk

In `/etc/asterisk/rtp.conf` (or `rtp_custom.conf` on FreePBX/Issabel):

```ini
[general]
icesupport=true
stunaddr=stun.l.google.com:19302
```

## Commonly used public STUN servers

| Server | Port |
|---|---|
| `stun.l.google.com` | 19302 |
| `stun1.l.google.com` | 19302 |
| `stun.stunprotocol.org` | 3478 |
| `stun.cloudflare.com` | 3478 |

A longer, community-maintained list of public STUN servers is available [here](https://gist.github.com/mondain/b0ec1cf5f60ae726202e).

**Note:**
STUN helps in most NAT situations. Behind very strict (symmetric) NAT or firewalls, a TURN server may be required to relay the media.
