SIP gateway has no internet

Hey guys!

I got a problem. My ISP has given me access to connect my Asterisk server to their trunk.

The network setting I got are nothing I’ve ever seen from them.

Basically they gave me a static IP a netmask and gateway to set in my asterisk server. All is fine it works as it should.

But that gateway has no internet acess and I’m having trouble connecting my Asterisk to the internet. I cant run updates and I can’t connect with my SIP client over the internet, only locally to my local Asterisk IP (lets call it

I have made a rule in my firewall to forward UDP port 5060 to but I still can’t connect from the outside.

eth1 (no access to internet only to private network from my ISP):


eth0 (connected to my local network that has access to internet)


Now I’ve tried changing default gateway on my asterisk, but then VOIP doesn’t work, but I can update the system. So whenever I wanna run an update I have to change the main gateway to and then back. Also I can’t get an external extension to connect to matter what I do. I’m currently solving the issue with a VPN connection :slight_smile:

Can you provide the output of


Please wrap your output in backticks



It’s called a private network and it is standard.

Simply remove the gateway from the Ethernet 1 config then put this in /etc/sysconfig/network-scripts/route-eth1


Save the file, type ifdown eth1 then ifup1 eth1 and ping the providers switch you should be good to go

Hey! Thanks for the fast replies, really great! Unfortunately, SkykingOH, I got this and it didn’t work :\

Error: an inet prefix is expected rather than "ADDRESS0:".
Error: an inet prefix is expected rather than "NETMASK0:".
Error: an inet prefix is expected rather than "GATEWAY0:".

here you go, jfinstrom :slight_smile:

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

Darn it completely forgot

the SBC-IP;

if it matters :slight_smile:


got it via


Sorry I made a type, did not mean to confuse:

THat’s what file should look like, right out of one of my servers.

Or 0, those are the entry sequence, you can add all the routes you want to this file

I got it to work by removing the gateway for eth1

and making a route for eth1 with via



There’s an issue I noticed now with remote extensions. I can’t hear them, they can’t hear me.

The issue is in Asterisk SIP settings.

If I set the external IP to the IP provided by the ISP for my private network the local extensions work but the remote ones don’t.

If I set the external IP to the one that is actually connected to the internet, then the remote extensions work but I can’t make an outgoing call or receive them. I don’t hear anything from an outside person.

Now I’m guessing I would have to make a route that when I call from a remote extension would go from eth0 to Although I’m really not sure how to do that…

to test without restarting networking

route add -net netmask gw

We covered all this and then adding to route file previously in post.

Is there something you need more information on?