Dual Nic Setup

Right now I am running dual nics on my Freepbx box.
All I am missing is a route somewhere I feel.
eth0 is gw sip trunk
eth1 is gw internal

My default gateway is currently set at
Everything internal works like a charm.
With this route via dev eth0 when I call out on the trunk it connects but has no voice.
What route would I need to add to get this working right?

When I flip the default gateway to sip trunk calls work great but internal is all messed up.

You need to add both networks to your SIP localnet settings in SIP settings module.

This didn’t work unfortunately.

Post output of the following commands from shell “route”, “ifconfig” and "asterisk -rx ‘sip show settings’

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface UGH 0 0 0 eth1 * U 0 0 0 eth0 * U 0 0 0 eth1
link-local * U 1002 0 0 eth0
link-local * U 1003 0 0 eth1
default UG 0 0 0 eth0

eth0 Link encap:Ethernet HWaddr 00:1D:92:03:20:3B
inet addr: Bcast: Mask:
inet6 addr: fe80::21d:92ff:fe03:203b/64 Scope:Link
RX packets:16080 errors:0 dropped:0 overruns:0 frame:0
TX packets:15285 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5377284 (5.1 MiB) TX bytes:4503275 (4.2 MiB)
Interrupt:23 Base address:0x4000

eth1 Link encap:Ethernet HWaddr 00:40:F4:3C:40:C3
inet addr: Bcast: Mask:
inet6 addr: fe80::240:f4ff:fe3c:40c3/64 Scope:Link
RX packets:4509 errors:0 dropped:0 overruns:0 frame:0
TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1230248 (1.1 MiB) TX bytes:29199 (28.5 KiB)
Interrupt:18 Base address:0xe000

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:3453 errors:0 dropped:0 overruns:0 frame:0
TX packets:3453 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:734463 (717.2 KiB) TX bytes:734463 (717.2 KiB)

asterisk -rx ‘sip show settings’

Global Settings:

UDP Bindaddress:
TCP SIP Bindaddress: Disabled
TLS SIP Bindaddress: Disabled
Videosupport: No
Textsupport: No
Ignore SDP sess. ver.: No
AutoCreate Peer: Off
Match Auth Username: No
Allow unknown access: Yes
Allow subscriptions: Yes
Allow overlap dialing: Yes
Allow promisc. redir: No
Enable call counters: No
SIP domain support: No
Realm. auth: No
Our auth realm asterisk
Use domains as realms: No
Call to non-local dom.: Yes
URI user is phone no: No
Always auth rejects: Yes
Direct RTP setup: No
User Agent: FPBX-2.10.1(11.4.0)
SDP Session Name: Asterisk PBX 11.4.0
SDP Owner Name: root
Reg. context: (not set)
Regexten on Qualify: No
Trust RPID: No
Send RPID: No
Legacy userfield parse: No
Send Diversion: Yes
Caller ID: Unknown
From: Domain:
Record SIP history: Off
Call Events: On
Auth. Failure Events: Off
T.38 support: No
T.38 EC mode: Unknown
T.38 MaxDtgrm: -1
SIP realtime: Disabled
Qualify Freq : 60000 ms
Q.850 Reason header: No

Network QoS Settings:

IP ToS RTP audio: EF
IP ToS RTP video: AF41
IP ToS RTP text: CS0
802.1p CoS SIP: 4
802.1p CoS RTP audio: 5
802.1p CoS RTP video: 6
802.1p CoS RTP text: 5
Jitterbuffer enabled: No

Network Settings:

SIP address remapping: Enabled using externaddr
Externrefresh: 10

Global Signalling Settings:

Codecs: (gsm|ulaw|alaw)
Codec Order: ulaw:20,alaw:20,gsm:20
Relax DTMF: No
RFC2833 Compensation: No
Symmetric RTP: Yes
Compact SIP headers: No
RTP Keepalive: 60
RTP Timeout: 120
RTP Hold Timeout: 300
MWI NOTIFY mime type: application/simple-message-summary
DNS SRV lookup: No
Pedantic SIP support: Yes
Reg. min duration 60 secs
Reg. max duration: 3600 secs
Reg. default duration: 120 secs
Sub. min duration 60 secs
Sub. max duration: 3600 secs
Outbound reg. timeout: 20 secs
Outbound reg. attempts: 0
Notify ringing state: Yes
Include CID: No
Notify hold state: Yes
SIP Transfer mode: open
Max Call Bitrate: 384 kbps
Auto-Framing: No
Outb. proxy:
Session Timers: Accept
Session Refresher: uas
Session Expires: 1800 secs
Session Min-SE: 90 secs
Timer T1: 500
Timer T1 minimum: 100
Timer B: 32000
No premature media: Yes
Max forwards: 70

Default Settings:

Allowed transports: UDP
Outbound transport: UDP
Context: from-sip-external
Record on feature: automon
Record off feature: automon
Force rport: Yes
DTMF: rfc2833
Qualify: 0
Keepalive: 0
Use ClientCode: No
Progress inband: Never
Tone zone:
MOH Interpret: default
MOH Suggest:
Voice Mail Extension: *97


By changing the NAT settings under sip settings I am able to get voice inbound working.

Changed it to route by the way.

I take that back here is what has be up and running with inbound voice only. Could use some help on the opposite.

cd /etc/sysconfig/network-scripts/

vi route-eth0
vi rule-eth0
from table intern
to table intern
vi rule-eth1
from table intern
to table intern
vi route-eth1
default via dev eth1 table intern via dev eth1 src table intern

You should not need NAT. Indicates something still wrong.

What device is doing the interVLAN routing? Is there a chance the remote devices are NAT’d

The interVLAN is done by switches and the router on the network. The is one of those vlans. is just the second nics IP and not part of the interVLAN. They could be nat’d once I send traffic to the default gateway. It connects to the metaswitch at the sip trunk provider.

The other problem is that is a part of my other vlan network.

Your problem is that sip can only bind to 1 network interface. see bindaddr in sip.conf
What are you trying to accomplish with the 2 nics?
You need something (like a firewall/router) to line up your subnets so they can all route through the one nic.

Actually everything would be much easier if I just used a router/firewall. You think I should try that with what I have described as my scenario? I just thought dual home and dual nics was the way to go when they provided private IP addresses and such.

To use multiple nics with Asterisk sip you can use nic bonding.
I have used this for awhile and it works great.
See this howto http://centoshelp.org/networking/nic-bonding/

I have seen that but I dont think with bonding you can assign one nic apart of sip provider private subnet and nic2 apart of your internal subnet. Can you? You suggest setting up a router with the SIP trunk providers internal network and run one nic or bonded nics through that correct?

As I stated above, you can not have one nic for the external trunk and the other nic for the internal phones. It does not work because you can only bind sip to one nic address. That is the bindaddr parameter in sip.conf.
So you still need to do some networking external to the asterisk box and then you can use the the nic bonding for the 2 nics. They will look like one address to Asterisk.

Inaccurate, you have use bindaddre of it’s not a pyhcical NOC binding.

This is well documented but can be confusing. The point is that bindaddr= allows Asterisk to bind to all addresses. However, it does not bind all the addresses together. So you could not bridge a sip call between eth0 and eth1.

I don’t understand your statement. I have many boxes with outside interfaces talking to the SIP provider and inside interfaces connecting to SIP phones. Without SIP directmedia Asterisk will act like a B2B UA and connect the two calls. You see two channels occupied per call in sip/core show channels.

Are we speaking of the same thing?

I did get this working without a router. I actually realized after I had setup my router that there was another IP address my sip trunk provider did not tell me about for outbound voice wanting to talk to my system. Once I added that to my dual nic routes everything is working like a charm.