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 192.168.0.154).

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

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

ip: 10.190.10.40
netmask: 255.252.0.0
Gateway: 10.188.0.1

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

ip: 192.168.0.154
netmask: 255.255.255.0
gateway: 192.168.0.1

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 192.168.0.1 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

route

Please wrap your output in backticks

``` 
 output 

``` 

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

ADDRESS0: 10.190.10.40
NETMASK0: 255.252.0.0
GATEWAY0: 10.188.0.1

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:10.190.10.40".
Error: an inet prefix is expected rather than "NETMASK0:255.252.0.0".
Error: an inet prefix is expected rather than "GATEWAY0:10.188.0.1".

here you go, jfinstrom :slight_smile:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
link-local      *               255.255.0.0     U     1003   0        0 eth1
10.188.0.0      *               255.252.0.0     U     0      0        0 eth1
default         10.188.0.1      0.0.0.0         UG    0      0        0 eth1

Darn it completely forgot

the SBC-IP; 84.255.210.213:5060

if it matters :slight_smile:

EDIT:

got it

84.255.210.213/32 via 10.188.0.1

:slight_smile:

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

ADDRESS1=10.38.58.0
NETMASK1=255.255.255.0
GATEWAY1=192.168.11.2
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

84.255.210.213/32 via 10.188.0.1

:slight_smile:

Hmm…

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 10.190.10.40. Although I’m really not sure how to do that…

to test without restarting networking

route add -net 10.190.10.0 netmask 255.255.255.0 gw 10.188.0.1

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

Is there something you need more information on?