Dual Nic Install

Get help with installing and running AsteriskNOW.

Moderators: Moderator, Support

Dual Nic Install

Postby chasemixon » Fri Nov 20, 2015 10:16 pm

We have 3 sip providers, one is a local mom and pop vendor and is directly connected to our Asterisk server, the ip from them is a internal IP. My other provider is an internet based SIP provider. We tried to add another SIP provider but when I add my trunk info that provider. it adds ok but I can't receive any calls from that provider. no audio then it hangs up the call. the provider sent me the trace of the test call but it is showing my eth1 gateway IP address instead of my eth0 gateway on the call??? is there some setting I can put in the trunk to tell that provider what IP address it is from? from the email

we are receiving 10.123.0.x for an RTP Ip from you...

I have tried fromdomain=216.x.x.x but that didn't help.

thanks in advance!
chasemixon
Newsterisk
 
Posts: 19
Joined: Wed Jun 25, 2014 6:57 am

Re: Dual Nic Install

Postby david55 » Sat Nov 21, 2015 5:22 am

This is a broken multi-homed configuration, rather than a dual NIC one. IP isn't designed to work like this. IP is designed to run with all its IP addresses advertised for all interfaces. That requires autonomous system numbers and border gateway (routing) protocol. You are not going to get those in this case.

The best solution to such configurations is to run two instances of Asterisk, but to really come up with any good solution, we need details of your network topology, the routes set on the box running Asterisk, and the contents of your sip.conf (with passwords removed). Actual IP addresses are best, but if you must obfuscate, retain the distinction between local use and public IP addresses, and between different sub-nets. Make sure that IP addresses that are the same are obfuscated the same, and similarly for sub-net prefixes.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Dual Nic Install

Postby chasemixon » Sun Nov 22, 2015 8:14 am

Thanks David for replying, well I have to have two separate nic's as the one nic for the mom and pop SIP provider is connected directly to the ISP no firewall, no switch, directly to there internal network. it doesn't have any internet traffic on this nic.

Here is the sip.conf, but I'm guessing you will need the other files mentioned in the include statements... just let me know which ones and I'll get them posted.

as far as network IP's
internal eth0 is 172.16.1.3 external 216.47.201.26

eth1
10.123.0.176

SIP.conf
;------------------------------------------------------------------------------
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications t
; this file must be done via the web gui. There are alternative files to make
; custom modifications, details at: http://freepbx.org/configuration_files
;------------------------------------------------------------------------------
[general]

; These files will all be included in the [general] context
;
#include sip_general_additional.conf

;sip_general_custom.conf is the proper file location for placing any sip genera
;options that you might need set. For example: enable and force the sip jitterb
;If these settings are desired they should be set the sip_general_custom.conf f
;
; jbenable=yes
; jbforce=yes
;
;It is also the proper place to add the lines needed for sip nat'ing when going
;through a firewall. For nat'ing you'd need to add the following lines:
; nat=yes , externip= , localhost= , and optionally fromdomain= .
;
#include sip_general_custom.conf

;sip_nat.conf is here for legacy support reasons and for those that upgrade
;from previous versions. If you have this file with lines in it please make
;sure they are not duplicated in sip_general_custom.conf, if so remove them
;from sip_nat.conf as sip_general_custom.conf will have precedence.
#include sip_nat.conf

;sip_registrations_custom.conf is for any customizations you might need to do to
;the automatically generated registrations that FreePBX makes.
;
#include sip_registrations_custom.conf
#include sip_registrations.conf

; These files should all be expected to come after the [general] context
;
#include sip_custom.conf
#include sip_additional.conf

;sip_custom_post.conf If you have extra parameters that are needed for a
;extension to work to for example, those go here. So you have extension
;1000 defined in your system you start by creating a line [1000](+) in this
;file. Then on the next line add the extra parameter that is needed.
;When the sip.conf is loaded it will append your additions to the end of
;that extension.
;
#include sip_custom_post.conf
chasemixon
Newsterisk
 
Posts: 19
Joined: Wed Jun 25, 2014 6:57 am

Re: Dual Nic Install

Postby david55 » Sun Nov 22, 2015 9:08 am

When I said sip.conf, I assumed you were using Asterisk natively. As you are using FreePBX, the relevant information will be in one or more of the files included by sip.conf.

The use of FreePBX also means that it is likely that either what you want is not within the scope of FreePBX, or will need to be done via the GUI.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Dual Nic Install

Postby chasemixon » Mon Nov 23, 2015 2:30 pm

see if any of this helps? sorry I thought I posted the question under AsteriskNOW, which is what I am running... (freepbx)

sip_general_additional.conf

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate. ;
;--------------------------------------------------------------------------------;
faxdetect=no
vmexten=*97
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
useragent=FPBX-13.0.17(11.11.0)
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
callevents=no
rtpend=20000
rtpstart=10000
jbenable=no
defaultexpiry=120
allowguest=yes
srvlookup=yes
minexpiry=60
maxexpiry=3600
registerattempts=0
registertimeout=20
notifyhold=yes
g726nonstandard=no
t38pt_udptl=yes,redundancy,maxdatagram=400
videosupport=no
maxcallbitrate=384
canreinvite=no
rtptimeout=30
rtpholdtimeout=300
rtpkeepalive=0
checkmwi=10
notifyringing=yes
nat=force_rport,comedia
externip=10.123.0.176
ALLOW_SIP_ANON=no
localnet=192.168.1.1/24
localnet=192.168.2.1/24
localnet=192.168.3.1/24
localnet=172.16.0.0/22
language=en

sip_registrations_custom.conf
defaultexpiry=3600


sip_registrations.conf
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate. ;
;--------------------------------------------------------------------------------;
register=USERNAME:PASSWORD@DOMAIN.com


sip_additional.conf

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate. ;
;--------------------------------------------------------------------------------;
(ALL MY EXTENSIONS) left out


[PowerNet1_IN]
host=IP ADDRESS
type=friend
context=from-trunk
canreinvite=yes
qualify=yes

[PowerNet1_Out]
context=from-trunk-sip-PowerNet1_Out

[sip0000001_baseamx]
host=Domain
defaultuser=USER
secret=PASSWORD
type=peer
context=from-trunk-sip-sip0000001_baseamx

[sip0000001_baseamxsip0000001_baseamx]
allow=all
context=from-trunk
host=DOMAIN
secret=PASSWORD
type=friend
defaultuser=USERNAME

[WOW-SIP]
host=DOMAIN
fromuser=USER
authname=USER
defaultuser=USER
secret=PASSWORD
type=peer
insecure=port,invite
dtmfmode=inband
context=from-trunk
canreinvite=no
qualify=yes
chasemixon
Newsterisk
 
Posts: 19
Joined: Wed Jun 25, 2014 6:57 am

Re: Dual Nic Install

Postby david55 » Mon Nov 23, 2015 2:57 pm

This line is causing them to receive the address they are receiving :

externip=10.123.0.176

I would expect this to contain your public address and that the mum and pop operation would have an address listed in your localnets.

The scope of this forum is only the installation of AsteriskNow and the Digium dahdi configuration module for it. For operational issues with FreePBX you want http://community.freepbx.org/ or one of their paid for support options.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Dual Nic Install

Postby chasemixon » Wed Nov 25, 2015 1:55 pm

oh ok thanks again David, I did see that, and when I changed that to my real external IP the mom and pop ISP calls would not come in, and since they handle 99% of our calls, at least right now, I can't kill off that...
chasemixon
Newsterisk
 
Posts: 19
Joined: Wed Jun 25, 2014 6:57 am

Re: Dual Nic Install

Postby sjshaffer » Fri Jan 08, 2016 9:17 pm

Have you setup a route via the static external NIC?
Linux seems to set the default to the local network (assuming you are using dhcp)

Try adding an explict route to your SIP provider via gateway connected othe external NIC

ip route add [SIP provider IP]/32 via [external gateway IP]

also copy this to your /etc/rc.local so it survives rebooting.
sjshaffer
Newsterisk
 
Posts: 1
Joined: Fri Jan 08, 2016 9:01 pm

Re: Dual Nic Install

Postby chasemixon » Mon Jan 11, 2016 7:57 am

Hey Steve, I really appreciate you taking some time to reply on this, we found another way around it, but we don't use DHCP, everything is Static, but yes I have routes setup for the mom and pop ISP so everything else goes out the external nic. It seems to me, of course I could be wrong, that freepbx takes whatever is in the External IP field and sends that to the ISP as the return path even though it didn't touch that route anywhere...?
chasemixon
Newsterisk
 
Posts: 19
Joined: Wed Jun 25, 2014 6:57 am

Re: Dual Nic Install

Postby david55 » Mon Jan 11, 2016 8:38 am

FreePBX will not do this. Asterisk will do it for every destination that it believes is subject to NAT, i.e. every destination that is not declared to be on a local network.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am


Return to AsteriskNOW Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest