SOLVED NOOB needs help: incrediblepbx.local issue and I need a Static IP on my Pi

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
Ok - so everything is working great on my Raspberry pi running IncrediblePBX PI... Except Two things.

I need to set up a port forward so my IAX trunk works and so my SIP phones know where to ping (Grandstream GXP2000). I have completed this and it works great until my Pi crashes or needs a reboot. Then the Pi's IP changes via DHCP and I have to reconfigure my port forward and the IP on my 3 phones. I've tried to setup a a MAC binding IP but it's not working either. My routeris TP-Link AC750 Archer D2.

I've trawled the forums and keep seeing posts that I should not setup a static IP. When I configure a static IP in nano /etc/network/interfaces, the Pi looses connection to the net (even though settings are correct) but I can dial internal extensions. I revert it back to DHCP and it gets internet connection back again and I can make outbound calls.

Also - When I visit http://incrediblepbx.local/ all I get is a broken screen. See attached.

Please help this is driving my insane.
 

Attachments

  • Screen Shot 2015-03-06 at 09.19.13.png
    Screen Shot 2015-03-06 at 09.19.13.png
    63.4 KB · Views: 11

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
Ok so my second issue i've worked out...

http://incrediblepbx.local/admin/config.php

Looks like The problem is that FreePBX overwrote the index.php file in /var/www/html.

To fix I created a new index_custom.php file in /var/www/html that looks like this and overwrote the old one:

Code:
<?php  header("Location: ./admin/config.php");  ?>



And hey-presto, it's now working. But i'm still having issues with the static IP thing. Any ideas?
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
when you configure the static entry, are you also defining a default gateway? Are you also defining a DNS server in /etc/resolv.conf?
 

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
Hey Synack

Thanks for getting back to me... My Static entry looks like this

Code:
iface eth0 inet static
address 10.1.12.2
netmask 255.255.255.0
network 10.1.12.0
broadcast 10.1.12.255
gateway 10.1.12.254

I am NOT updating or defining a DNS server in /etc/resolv.conf.

Let me try that now!

Is it ok to use googles 8.8.8.8 and 8.8.4.4?

 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
Just for clarification:
/etc/network/interfaces
Code:
iface eth0 inet static
address 192.168.x.y           #Static IP for Pi, should not be the same as another. X=whatever you use for your network, often 0 or 1.
netmask 255.255.255.0    #subnet mask - usually what I have given
network 192.168.x.0          #network designation, usually 0     
broadcast 192.168.x.255     #broadcast address, usually 25
gateway 192.168.x.254        #ip address of your firewall/default gateway, usually 1 or 254
/etc/resolv.conf
Code:
search home.local         #domain DNS suffix for your network, like dude.com or home.local. in your example above you would have just: search local                
nameserver x.x.x.x          # many home firewalls provide DNS, you would select the same IP as the gateway above. otherwise try google at 8.8.8.8
 

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
Ok so my nano /etc/network/interfaces looks like this

Code:
auto lo
auto eth0
 
iface lo inet loopback
iface eth0 inet static
address 10.1.12.2
netmask 255.255.255.0
network 10.1.12.0
broadcast 10.1.12.255
gateway 10.1.12.254
 
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa.conf
 
#up iptables-restore /etc/network/iptables

And my resolv.conf looks like this
Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#    DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4

Jay
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
Hey Synack

Thanks for getting back to me... My Static entry looks like this

Code:
iface eth0 inet static
address 10.1.12.2
netmask 255.255.255.0
network 10.1.12.0
broadcast 10.1.12.255
gateway 10.1.12.254

I am NOT updating or defining a DNS server in /etc/resolv.conf.

Let me try that now!

Is it ok to use googles 8.8.8.8 and 8.8.4.4?

Yep that's fine. your interfaces look good too.
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
Do you have the wlan0 active? with it configured as DHCP, DHCP will overwrite your resolv.conf.
 

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
NOPE - not working

See below... no public IP

It's driving me mad

Jay



Linux incrediblepbx 3.12.24+ #694 PREEMPT Tue Jul 15 17:34:35 BST 2014 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright and /root/COPYING.

Debian GNU/Linux and Incredible PBX come with ABSOLUTELY NO WARRANTY
to the extent permitted by applicable law.
No mail.
Last login: Fri Mar 6 13:36:19 2015 from 10.1.12.52
ALWAYS RUN INCREDIBLE PBX BEHIND A SECURE, HARDWARE-BASED FIREWALL!
SECURITY MATTERS. READY TO CHECK FOR UPDATES: /root/update-my-pi


This update utility goes to IncrediblePBX.com to retrieve the latest updates.
We test updates before release, but NO WARRANTY EXPRESS OR IMPLIED IS PROVIDED.
The first 10 updates are free. Calendar year update license is $20 per machine.
To sign up and make payment using a credit card, go to: http://nerd.bz/QwQkYO

To proceed solely at your own risk, press Enter. Otherwise, Ctrl-C to abort.

Retrieving... tar (child): lastupdate.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
rm: cannot remove `lastupdate.tar.gz': No such file or directory
/root/update-my-pi: line 23: /root/lastupdate: No such file or directory
rm: cannot remove `lastupdate': No such file or directory

No mail for root
curl: (6) Couldn't resolve host 'myip.pbxinaflash.com'
missing btime in /proc/stat
missing btime in /proc/stat
missing btime in /proc/stat
missing btime in /proc/stat
missing btime in /proc/stat

wlan0: error fetching interface information: Device not found


Screen Shot 2015-03-06 at 13.49.57.png
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
try a traceroute to 8.8.8.8
Code:
traceroute 8.8.8.8
also you seem to have your hostname missing in your /etc/hosts file
 

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
try a traceroute to 8.8.8.8
Code:
traceroute 8.8.8.8
also you seem to have your hostname missing in your /etc/hosts file


root@incrediblepbx:~# traceroute 8.8.8.8

-bash: traceroute: command not found

And
try a traceroute to 8.8.8.8
Code:
traceroute 8.8.8.8
also you seem to have your hostname missing in your /etc/hosts file


Code:
  GNU nano 2.2.6                                File: /etc/hosts                                                                       
 
::1            incrediblepbx localhost6.localdomain6 localhost6
127.0.0.1      localhost
127.0.0.1      incrediblepbx
127.0.0.1      incrediblepbx.local
127.0.0.1      noreply.incrediblepbx.com
 
# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
dag nabbit. I don't have a pi myself so I don't know exactly what comes on your distro or not.
You can try installing i think net-utils.
again i'm guessing here on distro, but i believe its
Code:
apt-get install net-utils
or you can try:
Code:
ping -R 9 8.8.8.8
I should probably mention, you may want to sanitize any external IP addresses before posting here, for your safety.
 

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
dag nabbit. I don't have a pi myself so I don't know exactly what comes on your distro or not.
You can try installing i think net-utils.
again i'm guessing here on distro, but i believe its
Code:
apt-get install net-utils
or you can try:
Code:
ping -R 9 8.8.8.8
I should probably mention, you may want to sanitize any external IP addresses before posting here, for your safety.



Code:
root@incrediblepbx:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=55 time=92.1 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=55 time=105 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=55 time=352 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=55 time=288 ms
64 bytes from 8.8.8.8: icmp_req=5 ttl=55 time=154 ms
64 bytes from 8.8.8.8: icmp_req=6 ttl=55 time=130 ms
64 bytes from 8.8.8.8: icmp_req=7 ttl=55 time=113 ms
64 bytes from 8.8.8.8: icmp_req=8 ttl=55 time=100 ms
64 bytes from 8.8.8.8: icmp_req=9 ttl=55 time=113 ms
64 bytes from 8.8.8.8: icmp_req=10 ttl=55 time=146 ms
64 bytes from 8.8.8.8: icmp_req=11 ttl=55 time=107 ms
64 bytes from 8.8.8.8: icmp_req=12 ttl=55 time=115 ms
64 bytes from 8.8.8.8: icmp_req=13 ttl=55 time=236 ms
64 bytes from 8.8.8.8: icmp_req=14 ttl=55 time=183 ms
64 bytes from 8.8.8.8: icmp_req=15 ttl=55 time=180 ms
64 bytes from 8.8.8.8: icmp_req=16 ttl=55 time=100 ms
64 bytes from 8.8.8.8: icmp_req=17 ttl=55 time=101 ms
64 bytes from 8.8.8.8: icmp_req=18 ttl=55 time=111 ms
64 bytes from 8.8.8.8: icmp_req=19 ttl=55 time=148 ms
64 bytes from 8.8.8.8: icmp_req=20 ttl=55 time=79.5 ms
64 bytes from 8.8.8.8: icmp_req=21 ttl=55 time=110 ms
64 bytes from 8.8.8.8: icmp_req=22 ttl=55 time=110 ms
64 bytes from 8.8.8.8: icmp_req=23 ttl=55 time=211 ms
64 bytes from 8.8.8.8: icmp_req=24 ttl=55 time=343 ms
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
I meant -R to record route, but that's moot anyway. Looks like you are getting internet all the way to google.
the Internet issue must then be related to DNS.
 

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
I've just reopened /etc/resolv.conf and found my nameservers have vanished.

Code:
  GNU nano 2.2.6                              File: /etc/resolv.conf                                                                 
 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#    DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

What does it mean when they say
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

If not by hand, then how do we set it?
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
do you have dig or nslookup?
Code:
 dig @8.8.8.8 myip.pbxinaflash.com
 

oxyfiremedia

New Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
Code:
root@incrediblepbx:~# dig @8.8.8.8 myip.pbxinaflash.com
 
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> @8.8.8.8 myip.pbxinaflash.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34715
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;myip.pbxinaflash.com.        IN    A
 
;; ANSWER SECTION:
myip.pbxinaflash.com.    14399    IN    A    74.86.213.25
 
;; Query time: 275 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Jan  1 01:39:25 1970
;; MSG SIZE  rcvd: 54
 
root@incrediblepbx:~#
 

Members online

Forum statistics

Threads
25,812
Messages
167,767
Members
19,242
Latest member
nana1
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.
Top