From owner-freebsd-current@freebsd.org Tue Sep 26 08:35:55 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92670E02E8C for ; Tue, 26 Sep 2017 08:35:55 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15430804DA for ; Tue, 26 Sep 2017 08:35:51 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MTTKZ-1dotco0d3H-00SMjL; Tue, 26 Sep 2017 10:35:49 +0200 Date: Tue, 26 Sep 2017 10:35:43 +0200 From: "O. Hartmann" To: freebsd-current , reebsd-ipfw@freebsd.org Subject: FreeBSD, IPFW and the SIP/VoIP NAT problem Message-ID: <20170926103543.0aa03c7a@freyja.zeit4.iv.bundesimmobilien.de> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ZNHFsDv8EvBt7dofT2gf0RY/dtRvT9G7YmHgsC2V7QIbvAgWKF2 MAc+BPxieX7wusivDLMDM6534hIv5cUGoVv87712Z5OXe2uH8pH3Y4/Wpomh1cyqJecg2d0 kx3LVNFcX4Rj7olMxJxeg/JPHW4RirvfLLa8CS0bXOo8eb+lNbWlkHNd5A4v1HPzmjbaY/Z eYBt3wL9oWtF+u0ZzbxHw== X-UI-Out-Filterresults: notjunk:1;V01:K0:RcDHZO1QyBE=:KxKq+0fmp2KyMBvX1MrxMG oDkxf953BhOqS6TiheoW3SOa6Gt6nulI+tUjjQwp3CWeT6ltkR5FEsPyFpSQKbl7X9uXuKP7c Dwc59AnBrGBz108+xssURCiKAtppesxJn+LiGhrKIv8baH9CiLyqQh0M1Kri7t1/EbR9bwhm8 tdFipgSON3bD66WUoKCoBAPJin8WC88sx4cjx1xJK1paum2z0hOG6aQ0chrju327JFyV6icPN zYBcQrHxIKr3+okdsquJnXb82+4TW4qGcNb7Lnr2JV9kxCV2VOdxU7gGYsWxXDas0c7ZIxJ90 J/pXK1dNKHDwX5WzVkM0Y1iFesAB3RcQZf7kyQHErLxVOwqL0/VYFzy15F3r8tZa328AdknWP CK7YZc6h99BF6SDaILPKx4kCxLN66ymke6wLORy130pXZRne9JU9qrNg/2UDgEKBiGRgMfZT1 0jcgfslJRRv9l3PyRGGWULzghSRM6YZXSU7D2HYvCj2HmiReAxwlgjLm0A8veCiOq6+MaaLNn OA7VTrro7f3OuNH/5QnfuBPYY98SU1b5vGxUXcU2HSflsCUu017a8XgfkDgbyYhZMj/JMyRYZ 6RlVfExLOV+POKKsxQ82E1WCSpahC5YP+t6slEm+3k0PlVDr+mrojmWTjvWnKs8e45weUnBHB RfQXdtZbe2ijxy9pYgBzIfiyzMFVUlwDXfIN8Hibvrty/c36J5nwNL1EUs5smPNVOKsNzFlyz 2ftAPo2WlR2sQcs+ILCIUSSQ6TxO1i5GJOtUqzwd0BKKNMzCjdwJTZ1o6s6yRdVeJ/d/pXIX8 i+o5QJijLeUdyrkBKkUUXqrg6BW5UlVZCsC40EPX5Msn96zDa4= X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Sep 2017 08:35:55 -0000 Hello, trying to build a FreeBSD based router/PBX (Asterisk 13) appliance, I ran into several problems. My questions might have a "noobish" character, so my apology, my experiences with IPFW are not as thorough as they should be. Before I'll got into medias res, aquestion about Pine64/AARCH64: - port net/asterisk13 is supposed to build only on armv6, is aarch64 about coming soon also supported? - would a Pine64 running CURRENT (12) be sufficient as a PBX platform (assumed having 2 GB of RAM)? My main concern is about IPFW (we do not use PF for some reasons, I have to stay with IPFW). I'm a customer of two ITSPs and my SoHo network is behind NAT and not yet IPv6. The FreeBSD system acting as a router is supposed to have a jail soon containing the Asterisk 13 IP PBX (at the moment running on the main system). To provide access to the VoIP infrastructure inside/behind the router/NAT system, the in-kernel NAT facility of FreeBSD is forwarding the relevant UPD/TCP ports for VoIP to its destination network, and here I have a problem to solve. While it is sumple and easy to forward 5060/udp, 5070/tcp and other ports, it is a mess and pain in the arse to forward a whole range, say 11000/udp - 35000/udp, which is a range one of my providers is sending RTP on. A second provider uses another range for RTP, starting at 5000/udp. So, the logical consequence would be a union set up UDP range to forward, which exapnds then form 5000/udp to 45000/udp - which is much more a pain ... One of the most disturbing and well known problems is that due to the stateful firewall the RTP session very often is half duplex - it seems one direction 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 payload of the packets on which UDP ports both ends wish to establish their RTP session, it would be "easy" to pinhole the IPFW on exactly those ports for a theoretical large number of sessions, if IPFW could "divert" those packets to an instance inspecting SDP (or whatever is used for the RTP port indication, I'm new to that, sorry for the terminology) and then pinholing the NAT/IPFW for exactly this purpose without the forwarding mess. I came along netgraph() while searching for hints and hooks, but it seems a complete Linux domain, when it somes to appliances like VoIP/IP PBX. Either, the problem is that trivial on FreeBSD, so no further mentioning is necessary (which would explain the vast emptyness of explanations, hints and so on) or FreeBSD is a complete wasteland on this subject - which I also suspect, since pfSense and OPNsense must have come along with such problems and I simply do not know or recognise the software used for those purposes. So, if someone enlightened in this matter stumbles over my question and could delegate me onto the right way (ports, ng_XXX netgraph ficilities to look at, some ipfw techniques relevant to the problem apart from the stupid simple forwarding large ranges of ports) - I'd appreciate this and thanks in advance for patience and help, Oliver