I have a linux Asterisk server that is behind a firewall. The firewall has three interfaces :
- eth0 is the LAN, where Asterisk resides,
- eth2 is the default gateway to the internet (via an ADSL modem / router),
- eth3 is a secondary internet connection
If I let things as is, Asterisk connects to the SIP trunk just fine. It will be routed via the default route through eth2. eth2 is MASQUERADED.
If I define a static route to my SIP provider via eth3 (
ip route add sip.provider.ip via gateway.ip dev eth3), I can ping the SIP proviver. Everything to and from my SIP provider is allowed by the firewall. But Asterisk will refuse to connect (peer become unreachable)...
I have used iptables TRACE to look at the packets, and they definitely get out via eth3. But I don't see any packet coming back. eth3 has also a MASQUERADE rule...
Removing the static route through eth3 restores the connectivity.
I'm looking for tips and hints to help troubleshooting the issue.