Skip to content

NethVoice Proxy: configure proxy bypass from the user interface #8375

Description

@edospadoni

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

Activity

  1. added this to the NethVoice 1.8 milestone on Nov 25, 2026
  2. added
    nethvoice
    on Nov 25, 2026
  3. self-assigned this
    on Nov 25, 2026
  4. changed the title [-]NethVoice: configure proxy bypass from the user interface[/-] [+]NethVoice Proxy: configure proxy bypass from the user interface[/+] on Nov 25, 2026
  5. edospadoni commented on Nov 25, 2026

    @edospadoni
    MemberAuthor

    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-rules shows 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

    • The instance menu lists only the NethVoice instances that run on the same node as the proxy
    • A wrong IP address, an address a device cannot have (for example 127.0.0.1), the same IP address twice, or a row without instance are refused with a clear message next to the field
    • The notice "Devices that are already sending traffic" appears only when the list differs from the saved one, and stays after saving
    • After saving and reloading the page the list is still there

    Test Case 2 - The device bypasses the proxy

    • Add the IP address of the device with its NethVoice instance and save: two rules with priority="-10" for that address appear in firewall-cmd --list-rich-rules
    • The device reaches NethVoice directly: its SIP messages are no longer in the Kamailio log, and Asterisk sees the IP address of the device as the source
    • An incoming and an outgoing call through the device stay up for more than 1 minute, with audio in both directions, and end when one side hangs up

    Test Case 3 - Device inside a local network of the proxy

    • Configure the proxy with a public address different from the node one and a local network that contains the device
    • The device in the bypass list still reaches NethVoice directly (Test Case 2), while the other devices of the same network go through the proxy

    Test Case 4 - Changes and removal

    • Change the SIP port of the proxy: the bypass rules follow the new port and the device still works
    • Remove the IP address and save: its rules are gone from firewall-cmd --list-rich-rules and the device goes through the proxy again
    • Remove the proxy instance with an IP address in the list: no bypass rule is left on the node

    Test Case 5 - Settings tabs and local networks

    • The settings form has the General and Advanced tabs; one Save button saves the fields of both
    • A wrong value in the Advanced tab (for example SIP port 80) brings that tab to the front with the message under the field
    • Without a public IP address a notice replaces the Local networks field and says why; the field appears as soon as a public IP address different from the interface address is typed in the General tab
    • With a public IP address different from the interface address, add a network (for example 192.168.5.0/24) and save: api-cli run module/nethvoice-proxyX/get-configuration returns it in local_networks, together with the network of the interface
    • A value that is not a network in CIDR format (for example 192.168.5.1/24) is refused with a message under the field; so is 0.0.0.0/0
    • Remove the added network and save: it is gone from local_networks

    Test Case 6 - Regression

    • Update a proxy that never used the list: settings are unchanged and no new firewall rule appears
    • Phones and trunks that go through the proxy keep working, with audio in both directions
    • Backup and restore of the proxy on the same node keeps the bypass list

    Testing image: PR build of nethesis/ns8-nethvoice-proxy#254

    ghcr.io/nethesis/nethvoice-proxy:pr-254.278-1.32987ea
    
    api-cli run update-module --data '{"module_url":"ghcr.io/nethesis/nethvoice-proxy:pr-254.278-1.32987ea","instances":["nethvoice-proxyX"],"force":true}'
    
  6. added
    testing
    on Nov 25, 2026
  7. moved this from Todo to Testing in NethVoiceon Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

nethvoicetesting

Projects

  • Status
    Testing

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions