* with 2 LAN cards

I have * with 2 nic. Is it possible that the extensions register in the local ip (NIC1) address and then if they call outside the office it will be routed to the other NIC (NIC2).

If so how? Thanks.

Yes you can do that. Not sure why but you will need to setup the route command if you are using linux.

I assume you have two different subnets, one for each card.

This is a good place to checkout the route command
comptechdoc.org/os/linux/use … uting.html -

or just google route linux


Hi. THanks for the reply. Here is the actual setup

NIC1 = LAN private IP
NIC2 = WAN public IP

stations > register/call > LAN > Asterisk > sends call > WAN.

Btw, can i bind the WAN ip to a certain extension “_x.” so that numbers matched are sent to our voip/sip provider instead of playin around with the route?

Thanks again.

How are you sending and receiving phone calls?
If you are using SIP or IAX then it is just a matter of setting rules in the extensions config file to use either the SIP or IAX trunk.

well. i haven’t setup inbound calls yet. n00b. :smiley:

exten => 2xxx,1,dial(sip/nameofextension)

outside call
exten => _x.,1,dial(sip/${exten}@provier}

i want ouside call routed to WAN nic.

If your second nic has an Ip address and all is setup for it with gateway, dns, etc… The system should be able to find it’s way out of your network for outbound calls.

yes that’s right. but how sure am i that the outbound calls/international calls go to that NIC/ip address? can i tweak in asterisk and not int hte routing instead?


it isn’t asterisk’s job to get involved in network routing issues. any policy decisions for asterisk should be routing calls based on phone numbers and such.

If that Nic is already setup and working then the system is going to find that route - assuming you have your trunks setup correctly.

You just need to tell Asterisk to use that trunk in your dialing plan… Forget about the Nic it appears to be a non-issue if it is up and working.

can you show me example how to route _x. to nic2?

btw, both nic 1 and 2 can browse internet.

If both nics can browse the internet, then why do you want to dedicate a nic to the external IP address. You would be far better off to use a firewall/router to route the traffic to that IP address. Easier too…

As was mentioned in a previous post, Asterisk is not going to route any calls through a specific nic card.

Because the situation is like this:

nic1 (private ip) > nat/firewall > 2mb internet

nic2 (public ip) > international private leased line 2mb > sip proxy > telco switch > customer

Please correct me here if im wrong:

If computers register in the public ip of * box, then they will pass via nat/firewall and public internet right?

If computers register in the private ip it will not go out public network right?

if both scenario are correct, i will be able to utilize 100mbps network + the 2mb leased line that terminates directly to our sip provider.

guys sorry if i sound repetitive. im n00b. :frowning:

you don’t seem to be listening. none of this is asterisk’s job. if you have an IP address or hostname that is reached via the other nic, asterisk will use it, otherwise it won’t.

ok. sorry again if i was persistent on making it possible. thanks for the effort in helping me. :smile:


I configured my trixbox with 2 NICs. One NIC with Public static Ip and the other with pirvate static IP.

I did this with webmin. I installed webmin on trixbox and configured the cards with a browser on port 10000.

But AsteriskNow does not allow connections to Asterisk_public_IP:10000.

Could some one tell me whats the best way to configure the second IP.
While installing AsteriskNow I configured both NICs but in reality the second NIC does not get configured.

Then I configured the second NIC with Network configuration utility in AsteriskNow but that does not seem to work either.

as been stated before asterisk isnt how the calls are routed to the external NIC.

in my setup I have eth0 connected to a public IP, and eth1 connected to my Local LAN.

calls made phone to phone are made with canreinvite=no so that asterisk always stays involved and they stay on the local LAN (eth1).

when a call is made to the SIP or IAX trunks, it is the ROUTING in LINUX that sends the calls over the first NIC (eth0). asterisk isnt a router it doesnt know where the IP routing will occur, its just a phone system.

it is a function of the OS in this case linux to handle it. so i have my eth0 defined as my default gateway and thus when the asterisk box accesses the internet it does so through its own internet NIC and doesnt try to go through the local LAN.

look up the ROUTE command that will get you in the right direction.

as for why 2 NICS? I dont have a router that supports QoS so I want to be sure the voice doesnt get stomped on by internet data traffic so the asterisk has its own internet connection.

I noticed this up in the list :smile: which I posted way back 25 Sep 2006. ANyway, I already removed the eth0 (LAN) because im having problem with both Deb3.1 and FC5 w/ Asterisk. For unknown reason one of the NICs installed will suddenly shutdown in the sense that it is up layer 1 and 2 but can’t be reached. I don’t if that problem be asnwered or not but of course i’ll be thankful :smiley:

Regarding the route command, yes I’ve been playing that on how I can make sure that destination IP should exit on eth1 (internet).

As i mentioned in my previous post:

Here is the actual setup
NIC1 = LAN private IP
NIC2 = WAN public IP

I want the SIP phones to register to *'s LAN IP so that registration doesn’t have to pass router and outside the internet. But since i disabled already the eth0 (LAN), i believe this is what is happening:

SIP phones > router > internet > Asterisk’s WAN IP.

yes I understand asterisk isnt how the calls are routed to the external NIC. My problem is configuring NIC2.
On my trixbox I did it by installing webadmin tool.

But on AsteriskNow when I type asterisk$sudo rpm -i webmin…
I get command not found. When I type asterisk$route I get the same thing command not found.

May be i need to reinstall all the packages from the install selection.

I understand its not an asterisk problem but a linux os problem. I could fix this with webadmin on another linux box, but here on AsteriskNow box I am having problems.

Like I said I will try installing everything and see if that will help.

Thanks Christopher and Flash05.

im not sure what webmin is… to set up my second NIC in centOS I just go cd/etc/sysconfig/network-scripts

and then make your ifcfg-ethx where x is the number of your NIC, 0 or 1 or 2 etc… and make a file similar to what i have below…

[root@pbx network-scripts]# vi ifcfg-eth1

obviously put in the true hardware address and IP address of the NIC,

after you are done you can either do an ifup eth1 or reboot the machine to bring it up the NIC.

then here is my Route table below having my default gateway set up to go out my ADSL line that is connected directly to my asterisk Box.

[root@pbx network-scripts]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
adsl-xx-xxx-xx- *      UH    0      0        0 ppp0     *        U     0      0        0 eth1     *          U     0      0        0 eth1
default         adsl-xx-xxx-xx-         UG    0      0        0 ppp0

of course I blanked out t he Real IP’s but gives you an idea…

granted im not running on a trixbox or an asterisknow. I simly built up a CentOS box and then manually installed asterisk, zaptel, addons, and the Gui. I tend to like having a built from scratch box as i can understand more how t is put together and what i have to work with and such.

Thanks Christopher, you make it sound so easy. This will help me a lot. My ip address is and netmask

I guess the broadcast address can be and network I believe broadcast and network address are reserved and I can have computers with addresses starting with -

I will try this soon and I think will will fix my problem.

Thanks again.