Most of my experience until recently has been in Asterisk 1.2, and I am just starting to make use of Asterisk 11 for new systems. I have a question about using SIP on a multi-homed machine. I have a customer who wants an Asterisk box with two network interfaces: one on the public Internet (no NAT), and one on a private LAN. The box will not do any IP forwarding between interfaces. They want to connect to a SIP trunk from an ITSP via the public interface, and to have SIP phones on their LAN registered via the private interface. I haven't tried such a setup before, so before creating a test system, I wondered if anyone here has made such a setup, and whether there are any issues with getting SDP contents and media routing correct? Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
john at millican.us
2013-Jul-31 14:53 UTC
[asterisk-users] Multi-homed SIP in Asterisk 11?
On 7/31/2013 10:32 AM, Tony Mountifield wrote:> Most of my experience until recently has been in Asterisk 1.2, and I am > just starting to make use of Asterisk 11 for new systems. > > I have a question about using SIP on a multi-homed machine. > > I have a customer who wants an Asterisk box with two network interfaces: > one on the public Internet (no NAT), and one on a private LAN. The box > will not do any IP forwarding between interfaces. They want to connect > to a SIP trunk from an ITSP via the public interface, and to have SIP > phones on their LAN registered via the private interface. > > I haven't tried such a setup before, so before creating a test system, > I wondered if anyone here has made such a setup, and whether there are > any issues with getting SDP contents and media routing correct? > > Cheers > TonyI built a setup like this a few years back. I believe the hurdle was more for the OS than asterisk. Let say the the two networks are 192.168.10.0/24 and 192.168.11.0/24 and the gateways are 192.168.10.1 and 192.168.11.1 respectively, and the asterisk box server has the two interfaces as 192.168.10.11 and 192.168.11.11 from memory(warning: my memory is not what it used to be): echo "1 TenNet" >> /etc/iproute2/rt_tables echo "2 ElevenNet" >> /etc/iproute2/rt_tables ip route add 192.168.10.0/24 dev eth0 src 192.168.10.11 table TenNet ip route add 192.168.11.0/24 dev eth1 src 192.168.11.11 table ElevenNet ip route add default via 192.168.10.1 dev eth0 table TenNet ip route add default via 192.168.11.1 dev eth1 table ElevenNet ip route show 2>&1 >> $logFile ip rule add from 192.168.10.11/32 table TenNet ip rule add from 192.168.11.11/32 table ElevenNet ip rule add to 192.168.10.11/32 table TenNet ip rule add to 192.168.11.11/32 table ElevenNet All that the above does is ensure that traffic is routed out the correct interface based on where it is headed. I.E. All traffic for 192.168.10.0/24 goes out eth0 all traffic for 192.168.11.0/24 goes out eth1 Then in asterisk I believe I add a localnet setting in sip.conf as 192.168.11.0, could be wrong on this though. JohnM
This is the standard way we set up our servers. There is nothing special about it. Just make sure you disable direct media. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tony Mountifield Sent: Wednesday, July 31, 2013 10:33 AM To: asterisk-users at lists.digium.com Subject: [asterisk-users] Multi-homed SIP in Asterisk 11? Most of my experience until recently has been in Asterisk 1.2, and I am just starting to make use of Asterisk 11 for new systems. I have a question about using SIP on a multi-homed machine. I have a customer who wants an Asterisk box with two network interfaces: one on the public Internet (no NAT), and one on a private LAN. The box will not do any IP forwarding between interfaces. They want to connect to a SIP trunk from an ITSP via the public interface, and to have SIP phones on their LAN registered via the private interface. I haven't tried such a setup before, so before creating a test system, I wondered if anyone here has made such a setup, and whether there are any issues with getting SDP contents and media routing correct? Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
On 31/07/13 15:32, Tony Mountifield wrote:> Most of my experience until recently has been in Asterisk 1.2, and I am > just starting to make use of Asterisk 11 for new systems. > > I have a question about using SIP on a multi-homed machine. > > I have a customer who wants an Asterisk box with two network interfaces: > one on the public Internet (no NAT), and one on a private LAN. The box > will not do any IP forwarding between interfaces. They want to connect > to a SIP trunk from an ITSP via the public interface, and to have SIP > phones on their LAN registered via the private interface. > > I haven't tried such a setup before, so before creating a test system, > I wondered if anyone here has made such a setup, and whether there are > any issues with getting SDP contents and media routing correct? > > Cheers > TonyI normally just ensure localnet= and externip= is set correctly. I normally also have 'directmedia=no' defined in sip.conf so that asterisk is performing store and forward for all the rtp traffic. That does mean rtp traffic for internal calls is going via asterisk where it could be direct between the phones but the amount of traffic doing this is normally pretty trivial so it doesnt matter in most cases.