TIPS Internet Access for PIAF

Phil J

New Member
Joined
Nov 12, 2013
Messages
4
Reaction score
0
We have PIAF running perfectly on VirtualBox (Note we did have to change VirtualBox ethernet adapter to the "PIII Fast" option to overcome audio quality issues)

This is more of a high level question. Our ip/gateway is statically assigned via ifcfg-eth0 on Centos to an interface that is routed to our trunk (192.168.1.8) , which is not internet connected. Thus calls works perfectly, but we are unable to update the pbx or email voicemails, etc and "Internet" shows "False".
Is there a way to tell Piaf to route any internet traffic through our main gateway, 192.168.1.2? Or would the best way to accomplish this be defining some custom route on the router itself?


Asterisk = ONLINE | Dahdi = ONLINE | MySQL = ONLINE |
| SSH = ONLINE | Apache = ONLINE | Iptables = ONLINE |
| Fail2ban = ONLINE | Internet = OFFLINE | Ip6Tables = ONLINE |
| Disk Free = ADEQUATE| Mem Free = ADEQUATE| NTPD = ONLINE |
| SendMail = ONLINE | Samba = OFFLINE | Webmin = ONLINE |
| Ethernet0 = ONLINE | Ethernet1 = N/A | Wlan0 = N/A |
| |
| PIAF Installed Version = 2.0.6.4 under *VIRTUALBOX* |
| FreePBX Version = 2.11.0.11 |
| Running Asterisk Version = 11.5.1 |
| Asterisk Source Version = 11.5.1 |
| Dahdi Source Version = 2.7.0.1 |
| Libpri Source Version = 1.4.14 |
| IP Address = 192.168.1.5 on eth0 |
| Operating System = CentOS release 6.4 (Final) |
| Kernel Version = 2.6.32-358.23.2.el6.i686 - 32 Bit
 
Why is your gateway setup as your PBX instead of your main gateway? I am confused.
 
192.168.1.8 is an interface that was provided for us from a router set up by our fiber/trunk provider Windstream. The actual trunk IP is set in the trunk settings in PIAF as 10.250.x.x and is only accessible through 192.168.1.8. So, the PIAF virtual machine (192.168.1.5) has its gateway set as 192.168.1.8 and all call features work perfectly.

HOWEVER, Our internet gateway/dhcp server is 192.168.1.2. I am wondering how we can set the PIAF instance to connect through our 192.168.1.2 for updates and email, but through the 192.168.1.8 for calls.

At this point the only solution I can think of is to set the PIAF gateway to .1.2 and set up some routing rule to route any requests going to 10.250.x.x to forward through 192.168.1.8 only.
 
192.168.1.8 is an interface that was provided for us from a router set up by our fiber/trunk provider Windstream. The actual trunk IP is set in the trunk settings in PIAF as 10.250.x.x and is only accessible through 192.168.1.8. So, the PIAF virtual machine (192.168.1.5) has its gateway set as 192.168.1.8 and all call features work perfectly.

HOWEVER, Our internet gateway/dhcp server is 192.168.1.2. I am wondering how we can set the PIAF instance to connect through our 192.168.1.2 for updates and email, but through the 192.168.1.8 for calls.

At this point the only solution I can think of is to set the PIAF gateway to .1.2 and set up some routing rule to route any requests going to 10.250.x.x to forward through 192.168.1.8 only.

Yes, set the default route to 192.186.1.2 and setup a static route to 10.250.0.0/16 or even 10.0.0.0/8 (255.255.0.0 or 255.0.0.0). That's the best solution I can think of. You can google setup static route in Centos 6 for instructions.
 
Thank you atsak,

/etc/sysconfig/network-scripts/route-eth0 now echos the following:
10.250.0.0/16 via 192.168.1.8

route -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
10.250.0.0 192.168.1.8 255.255.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.1.2 0.0.0.0 UG 0 0 0 eth0

I can traceroute the trunk IP and it shows 192.168.1.8 as first hop (Correct).
I can traceroute 66.243.108.11 (mirror1.freepbx.org) and it shows 192.168.1.2 as first hop (Correct).
all calls function incoming and outgoing.

However, status still shows Internet = Offline and module updates time out (even though I can ping the update server above!)

I ran the following to see if the previous gateway was set in some PIAF config somewhere file but found nothing:

grep -R --exclude-dir=sys '192.168.1.8' /

ifconfig:
eth0 Link encap:Ethernet HWaddr 08:00:27:F6:8C:62
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fef6:8c62/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1036486 errors:1003 dropped:0 overruns:0 frame:0
TX packets:585180 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:150910044 (143.9 MiB) TX bytes:115323403 (109.9 MiB)
Interrupt:19 Base address:0xd020


I'm at a loss as to why PIAF shows offline when ping and traceroute show otherwise.
 
If you can connect reliably, don't worry about status. You've got an "odd" network setup that probably was not envisioned when status was written.
 
Bingo Hyksos.

cat /etc/resolv.conf:
; generated by /sbin/dhclient-script
nameserver 192.168.0.1


cat /etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=pbx.local


cat /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.5
NETMASK=255.255.255.0
GATEWAY=192.168.1.2

After editing.....

cat /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.5
NETMASK=255.255.255.0
GATEWAY=192.168.1.2
DNS1=192.168.1.2
DNS2=8.8.8.8

service network restart

cat /etc/resolv.conf:
; generated by /sbin/dhclient-script
nameserver 192.168.1.2
nameserver 8.8.8.8



Problem solved!
 

Members online

No members online now.

Forum statistics

Threads
26,687
Messages
174,409
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top