When using a Fritzbox behind an OPNsense firewall for SIP-based VoIP, users often encounter issues such as dropped calls, failed registrations, or intermittent connectivity. This guide addresses these challenges by focusing on optimizing your OPNsense SIP VoIP configuration. This guide focuses on optimizing your OPNsense SIP VoIP configuration to resolve these problems. For example, incoming calls might not ring consistently, or outgoing calls may occasionally fail without explanation. These issues arise from the interaction between SIP protocols, NAT (Network Address Translation), and firewall rules. SIP is highly sensitive to how NAT handles its connections, and improper configurations can lead to packet loss or timeout errors.
This guide explains how to resolve these issues by configuring OPNsense and the Fritzbox for seamless SIP and RTP communication, ensuring a reliable OPNsense SIP VoIP configuration.
Why Proper Configuration is Essential
SIP communication requires a stable connection between the Fritzbox and the SIP provider’s servers, making a proper OPNsense SIP VoIP configuration essential for reliable communication. Unlike other protocols, SIP embeds critical connection information (such as IP addresses and ports) within its message payloads. When NAT modifies these headers, it disrupts the protocol’s ability to maintain a connection, leading to dropped calls or registration failures.
Key adjustments to address these issues include:
- Outbound NAT with Static Ports: Ensures SIP packets retain their original source ports, which is critical for proper registration and call setup.
- Firewall Rules: Allows SIP and RTP traffic to traverse the network unimpeded, ensuring both signaling and audio flow are not disrupted.
- Disabling SIP ALG: Prevents interference with SIP packets, which can lead to registration failures or audio issues.
- Keep-Alive Settings: Ensures NAT mappings remain active by periodically sending packets, avoiding timeout problems.
- Firewall Optimization: Increases connection timeout durations to prevent premature disconnections during long VoIP sessions.
By implementing these configurations, users can create a reliable environment for VoIP and avoid common issues like call drops or failed registrations.

The AVM FRITZ!Box 7590 AX delivers ultra-fast Wi-Fi 6, powerful Gigabit ports, and an advanced telephony system. Perfect for maximum speed, stability, and smart home connectivity!
Step 1: Configuring Outbound NAT with Static Ports
To prevent SIP-related NAT issues, configure OPNsense to use static ports for the Fritzbox.
- Navigate to Firewall > NAT > Outbound.
- Set the mode to Hybrid and save.
- Add a new NAT rule with the following settings:
- Interface: WAN
- Protocol: UDP
- Source Address: IP address of the Fritzbox (e.g., 192.168.x.x).
- Source Port: Any
- Destination Address: Any
- Destination Port: Any
- Translation: Interface Address
- Static Port: Enabled
- Save and apply the changes.
Purpose: Ensuring consistent source ports allows SIP providers to maintain a stable connection with the Fritzbox.
Step 2: Allowing SIP and RTP Traffic Through Firewall Rules
Ensure the Fritzbox can communicate freely for both SIP signaling and RTP audio traffic.
- Navigate to Firewall > Rules > [VLAN of the Fritzbox].
- Add a rule for SIP traffic:
- Action: Pass
- Protocol: UDP
- Source: Fritzbox IP
- Destination: Any
- Destination Port: 5060 (SIP port).
- Add a rule for RTP traffic:
- Protocol: UDP
- Source: Fritzbox IP
- Destination: Any
- Destination Port: 49152-65535 (RTP ports).
- Save and apply the rules.
Purpose: These rules ensure signaling and voice traffic are not blocked, enabling successful call setup and audio transmission.
Step 3: Disabling SIP ALG
SIP ALG can interfere with SIP traffic, often causing issues like registration failures or one-way audio. Verify that SIP ALG is disabled:
- Navigate to Firewall > Settings > Advanced.
- Check the box for Disable SIP ALG.
- Save the settings.
Purpose: Disabling SIP ALG ensures that SIP packets are not modified by the firewall, preserving their integrity for successful communication.
Step 4: Optimizing Firewall Settings
Adjust the firewall’s optimization mode to support long VoIP sessions.
- Go to Firewall > Settings > Advanced.
- Set the Firewall Optimization mode to Conservative.
- Save the settings.
Purpose: This mode increases connection timeout durations, preventing premature disconnections during long-running VoIP calls.
Step 5: Configuring Fritzbox Keep-Alive Settings
To maintain SIP registrations and prevent NAT-related timeouts, configure the Fritzbox’s keep-alive feature.
- Access the Fritzbox interface.
- Navigate to Telephony > Own Numbers > Connection Settings.
- Enable Keep port forwarding of the internet router active.
- Set the interval to 5 minutes (or lower if needed).
- Save the settings.
Purpose: Keep-alive packets ensure that NAT mappings remain active, preventing registration drops and connection timeouts.
Step 6: Testing and Troubleshooting
- Check Firewall Logs: Use Firewall > Logs > Live View in OPNsense to ensure SIP and RTP packets are not blocked.
- Examine Fritzbox Logs: Go to System > Events > Telephony in the Fritzbox to identify registration errors (e.g., “403 Not Registered”).
- Conduct Stability Tests: Make multiple test calls to verify the reliability of both incoming and outgoing calls.
Conclusion
By following these steps for OPNsense SIP VoIP configuration, including outbound NAT settings, firewall rules, and keep-alive optimization, you can achieve a reliable and stable VoIP environment. Regularly monitor logs to quickly identify and resolve any potential issues.