nat.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #####
  2. Network Address Translation
  3. #####
  4. NAT is Network Address Translation. When your FusionPBX and/or FreeSWITCH are inside NAT then then you may experience one way audio or no audio in either direction the following information can help you get audio working in both directions.
  5. Default config
  6. ^^^^^^^^^^^^^^^
  7. The external_rtp_ip and external_sip_ip are set to $${local_ip_v4} in Advanced -> Variables by default or Advanced > Sip Profile settings. The local_ip_v4 variable is auto detected by FreeSWITCH. The variable can be also be overidden as a preset variable before it is used if you want to control the IP address that it represents.
  8. * This works good when the server has a public IP address.
  9. * It also works well when all phones are inside the same network and nothing needs to traverse the NAT. For example if you are using a SIP to TDM gateway and all your phones are in the same network.
  10. `SIP ALG`_
  11. ^^^^^^^^^^^^^^^
  12. A SIP Application Layer Gateway (ALG) is a tool designed to help SIP traverse NAT. While the SIP ALG is good in theory it often causes more problems than it solves. Because of this it's usually best to disable the SIP ALG on your firewall. An alternative way to disable it is to move SIP to a non standard port.
  13. Static IP
  14. ^^^^^^^^^^^^^^^
  15. FusionPBX is behind NAT and you have a static public IP address and you have phones on the same network and/or outside the network.
  16. * Set external_rtp_ip to autonat:xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx can be used also in some instances)
  17. * Set external_sip_ip to autonat:xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx can be used also in some instances)
  18. * If you don't register a gateway to the carrier you may need to port forward SIP and RTP.
  19. UPnP or PMP
  20. ^^^^^^^^^^^^^^^
  21. FusionPBX is behind NAT and you don't have a static ip address. You do have a firewall that is capable of UPnP or PMP.
  22. * Enable UPnP or PMP in your firewall
  23. * In Debian OS /etc/default/freeswitch remove -nonat
  24. * Make systemd aware of the changes. systemctl daemon-reload
  25. * Set external_rtp_ip to auto-nat
  26. * Set external_sip_ip to auto-nat
  27. * Restart FreeSWITCH. service freeswitch restart
  28. Symptoms of misconfigured NAT
  29. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  30. * Call drops after 32 seconds.
  31. * One way audio
  32. * No audio
  33. .. _SIP ALG: http://docs.fusionpbx.com/en/latest/firewall/firewall_devices.html#sip-alg