Repository navigation
Description
Some local gateways and trunks do not work through the NethVoice proxy, so their calls must reach the NethVoice instance directly. Today this "proxy bypass" is set up by hand with firewall commands on the node, following the Bypass proxy for trunks tutorial. The manual steps are easy to get wrong and they fail in two common cases:
- When the proxy is behind NAT (Network Address Translation) and the gateway is inside a local network, the rule added by hand is ignored: the proxy already has a rule for the whole local network, and the firewall uses that one first. Calls from the gateway still reach the proxy and are rejected.
- Even when the rule works, incoming calls are closed after about 30 seconds. The gateway sends the messages that follow the first one to the port of the NethVoice instance, and the firewall does not open that port.
The purpose is to let an administrator declare the devices that must skip the proxy from the user interface, with no firewall commands.
Proposed solution
Add a "Proxy bypass" list to the advanced settings of the NethVoice proxy application. Each item has:
- the IP address of the device, for example a local gateway
- the NethVoice instance that receives its calls, chosen from the instances running on the same node as the proxy
When the settings are saved, the proxy creates the firewall rules needed for each item, and removes them when the item is removed or the application is uninstalled. The rules:
- take precedence over the rules of the local networks, so a device inside a local network is bypassed too
- open the port of the NethVoice instance for that device, so calls are not closed after 30 seconds
- follow a change of the SIP port of the proxy
The same list is available from the command line as the bypass_sources parameter of the configure-module action.
Alternative solutions
Keep the manual procedure and fix the tutorial, adding the rule priority and the rule that opens the port of the instance. It stays error-prone, and the rules are not updated when the SIP port of the proxy changes.
Additional context
Only SIP over UDP is bypassed, as in the tutorial.
A device that is already sending traffic to the proxy keeps reaching it until it stays silent for about two minutes, because the node remembers its connection. The user interface warns about it. Clearing those connections when the list changes would need a change in the NethServer 8 core, which is out of scope here.
On the NethVoice side nothing changes: the trunk of the device must have no outbound proxy.
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTesting
Activity
[-]NethVoice: configure proxy bypass from the user interface[/-][+]NethVoice Proxy: configure proxy bypass from the user interface[/+]edospadoni commentedon Nov 25, 2026
Test
PRs: nethesis/ns8-nethvoice-proxy#254
Docs: NethServer/nethvoice-docs#109
Setup: a NethVoice Proxy and a NethVoice instance on the same node, plus a SIP device that talks UDP and does not work through the proxy (for example a gateway, here
192.0.2.10). The new list is in the proxy app, Settings, in the Advanced tab, under Proxy bypass. On the node,firewall-cmd --list-rich-rulesshows the rules the proxy creates.A device that is already sending SIP traffic keeps its current path until it stays silent for about 2 minutes: after each change, stop the device for that time (or restart the node) before checking.
Test Case 1 - Settings page
127.0.0.1), the same IP address twice, or a row without instance are refused with a clear message next to the fieldTest Case 2 - The device bypasses the proxy
priority="-10"for that address appear infirewall-cmd --list-rich-rulesTest Case 3 - Device inside a local network of the proxy
Test Case 4 - Changes and removal
firewall-cmd --list-rich-rulesand the device goes through the proxy againTest Case 5 - Settings tabs and local networks
192.168.5.0/24) and save:api-cli run module/nethvoice-proxyX/get-configurationreturns it inlocal_networks, together with the network of the interface192.168.5.1/24) is refused with a message under the field; so is0.0.0.0/0local_networksTest Case 6 - Regression
Testing image: PR build of nethesis/ns8-nethvoice-proxy#254