📜 ⬆️ ⬇️

Technical support 3CX responds: configure the router for the PBX VoIP server

If you plan to connect SIP trunks from telecom operators or remote users to the 3CX system, and your PBX is located in a private network - a static publication (“forwarding”) of ports should be performed on the firewall.

VoIP applications use RTP to transfer multimedia streams (audio and video). Difficulties may arise when passing edge network devices (firewalls and routers). This is due to the fact that RTP uses random port numbers to send and receive multimedia traffic. An incorrect configuration of the firewall manifests itself as one-way audibility or no sound at all from a VoIP provider and remote users.

The problem of VoIP with symmetric NAT (Symmetric NAT)


When using symmetric NAT, the edge network device dynamically changes the port number to which the audio stream is received. For example, when making an outgoing call via the operator's SIP trunk, 3CX first makes a STUN request to determine its external IP address and the current port number. Then this address and port are transmitted to the operator's SIP-server for mutual communications. But at this time, your firewall dynamically closes this port (which has already been transferred to the operator - indicated in the INVITE header). There is an audio transfer failure. Obviously, because of this feature, it is impossible to ensure reliable operation of VoIP. In the firewall configuration guides, this technology is called symmetric NAT (Symmetric NAT).

Solving the problem with one-way audibility in VoIP - Full Cone NAT


To solve the problem of one-way audibility (or complete "silence"), you should configure the so-called conical NAT (Full Cone NAT), which is also known as one-to-one NAT. In it, the necessary ports on the external address of the router are mapped (or “forwarded”) to a specific internal address (the port number is preserved). The external host exchanges RTP packets with the internal host, sending them first to the external address of the router and the external (mapped) port.

In fact, the vast majority of network devices support this mode. As a rule, it is called "Static port mapping". Static publishing ensures that a particular port always remains open and never changes with a firewall. Some very cheap routers incorrectly implement this function, but most, as was said, allow you to properly configure the "forwarding" of ports. At the end of the article are examples of the appropriate configuration of various network devices.

Checking the correct operation of the firewall service 3CX Firewall Checker


A good way to check the configuration of a network device (finding out if you are behind Symmetric NAT and other configuration problems) is to use the 3CX Firewall Checker service.

3CX Firewall Checker allows you to check in advance that your edge network device correctly processes VoIP traffic from SIP operators, 3CX bridges, external SIP clients and connections using 3CX Tunnel technology. Consider a simple example of how to use this service. For example, let's assume that the 3CX server has an address of 192.168.0.100, testing is performed on port 9500, and the external address of your network is 11.22.33.44.

As it was said, the correct publication of the port means that any outgoing UDP packet from the PBX server with the source IP :: Port source address - 192.168.0.100::9500 should reach the recipient (usually this is the carrier’s SIP server, remote IP phone or another PBX 3CX) with the “rewritten” source address of source IP :: Port - 11.22.33.44::9500. Although the address is being broadcast (which is necessary for routing a packet on a public WAN), the packet port does not change . In addition, any UDP packet coming from the WAN with the destination IP :: Port destination address - 11.22.33.44::9500 must reach the 3CX server with the destination IP :: Port address - 192.168.0.100::9500. 3CX Firewall Checker is just used to check the correct address translation, and also finds out another important one.

To launch 3CX Firewall Checker, go to the 3CX management interface> Home section> PBX Status section> click Firewall> Start.



After starting, the network tests will begin. Depending on the type of edge device and the actual configuration, you will see the result along with troubleshooting tips.

Attention: Starting 3CX Firewall Checker stops some 3CX services, so during the tests, the PBX will be unavailable. If the port is tested successfully, it takes 1 second. Unsuccessful testing of the port is stretched for 5-10 seconds. By default, ports in the range of 9000 - 10999 are tested. If initially everything is configured correctly, testing will take less than a minute. If problems arise, testing is delayed for 4-9 minutes. However, at any time you can stop the test.

The service uses the STUN server of 3CX, which must be installed in Settings> Network> Public IP. Some firewalls may incorrectly qualify this test as port scans. If this happens, 3CX Firewall Checker reports a problem at the very beginning of the test. Therefore, in the firewall, you should disable the scan scan before testing.

3CX Firewall Checker Tests


The utility checks the correctness of the hardware configuration, making various requests to the STUN-servers. Conducted two tests.

Internet accessibility


This test checks the availability of STUN servers from the 3CX server's verifiable ports. The operation of the DNS is also checked (STUN servers in 3CX are indicated by FQDN).

If this test fails, the following problems are possible:


The correctness of the publication of ports (Full Cone NAT)


This test tests the ability of the server on the Internet to communicate with the 3CX server on the internal network. The configuration of the one-to-one port translation (Full Cone NAT) is being tested.

3CX Firewall Checker sends a request to the STUN server from the (number) port that is being checked, and requests the STUN server to create a connection to the PBX server on this port from the external IP address. If the second test fails, check the following settings:


Test results / error messages


We list the test results and errors returned by the Firewall Checker.

This is a port for forwarding. VoIP can work. This configuration is supported (Success - the port is published correctly. VoIP communications will work. This configuration is supported by 3CX).

All tests passed successfully. Your border device allows traffic to the Internet from the tested port and correctly converts the ports one to one. Configuration supported.

STUN server has no second address (STUN server does not have a second address).

The message appears if the STUN server is configured incorrectly in the 3CX interface. STUN server must have two addresses. In Settings> Network> Public IP, specify the following STUN servers: stun-eu.3cx.com, stun2.3cx.com, stun3.3cx.com.

Failed - No response received or port mapping is closed. Port forwarding is not configured correctly. The answer is not received or the port is closed. Incorrect setting of the publication of the port.

The publication of the checked port is incorrectly configured. In this case, VoIP operators and remote IP phones will not work. Configure publishing ports for these guides .

Failed - Firewall check failed. Some errors were detected. Please check your firewall configuration and try the test again (Failed - the firewall check failed. Errors were detected. Check the firewall configuration and try again).

This message appears if some ports have passed the test, but some have not. Pay attention to which specific ports failed the test and publish them. Also make sure that these ports are no longer published on the router for a different internal IP address.

Failed - Malformed response received - (aka Symmetric NAT). Port forwarding not correctly implemented (failed - an incorrect response was received (possibly symmetric NAT). The publication of ports was incorrectly configured).

The answer indicates that Full Cone NAT does not work correctly for you.

The STUN server did not respond or port forwarding (the STUN server did not respond or did not configure the publication of ports on the firewall).

Your STUN server is not responding. Possible reasons:


STUN server address cannot be resolved (the server’s IP address is not resolved by DNS).

Could not determine the IP address of the STUN server by its name. This may indicate problems with your DNS server, but also that this STUN server has stopped working forever.

Failed - Malformed servers STUN servers. STUN servers from Settings → Network → External IP Configuration section Check for an Internet connection, DNS settings, or use another STUN in the Settings → Network → section. External IP).

The answer says that the ports are published correctly or your firewall blocks packets.

Failed - Port {0} or SIP port. The 3CX Firewall checker requires the SIP port to be free (The port is being used by another application on this server OR the SIP port is used by the {0} process. The 3CX Firewall checker service requires a free SIP port.

The test port is being used by another application installed on this server. To determine the specific process run the command

netstat -ano | findstr /I /C:"PID" /C:":9500"

where 9500 is the port number. In the PID column, you will see the process ID. Use Task Manager to identify the process. You can also execute the command

tasklist /fi "pid eq 4"

where 4 is the process ID.

STUN servers are not reachable. Cannot perform Firewall check. This configuration is not supported (STUN servers are unavailable. Cannot perform firewall check. Configuration is not supported).

STUN servers configured in the 3CX interface are not available. As a rule, this is due to problems with Internet access. In Settings> Network> Public IP, specify the following STUN servers: stun-eu.3cx.com, stun2.3cx.com, stun3.3cx.com.

Additional Information


Source: https://habr.com/ru/post/437442/