Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Sep 2017 14:12:58 +0200
From:      Damjan Jovanovic <>
To:        Guido Falsi <>
Cc:        "O. Hartmann" <>, freebsd-current <>,
Subject:   Re: FreeBSD, IPFW and the SIP/VoIP NAT problem
Message-ID:  <>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Tue, Sep 26, 2017 at 11:27 AM, Guido Falsi <> wrote:

> On 09/26/2017 10:35, O. Hartmann wrote:
> > of the RTP connection doesn't make it through IPFW/NAT. As often I
> search the
> > net, I always get informed this is a typical problem and solutions are
> > provided by so called ALGs - since SIP protocol's SDP indicates within
> the
> This would require coding it in IPFW, and the load on the firewall could
> be significant.
> It could be done in userland maybe, leveraging divert(4) and having a
> daemon listening there and doing the extra work, but this would be quite
> expensive. Depending on your call volume the load could be too much for
> your firewall.
SIP headers like Proxy-Authorization need to send a cryptographic quality
hash of data that includes the password and the SDP when qop=auth-int, and
the ALG needs to change the IP address and port in the SDP, which changes
this hash. The ALG would have to know your password to calculate the new

A SIP ALG can thus only work with the weaker qop=auth protection, which
doesn't hash the SDP and is thus less secure (MITM attacks can
capture/modify RTP in transit), and even then it would have to be careful
not to change the SIP headers which are included in the hash.

Since it is the provider that chooses the allowed qop, a general SIP ALG is
impossible unless the ALG knows the password.

Linux has a SIP ALG in iptables, and it's full of problems and best

Want to link to this message? Use this URL: <>