Problem trying to set static IP address--SOLVED! (I think)

General Discussion

Problem trying to set static IP address--SOLVED! (I think)

Postby CF86336 » Mon Oct 19, 2015 7:26 pm

I tried to use the Host settings page on my ADT2PI Network Appliance to set a static IP address of 192.168.1.40 and had something strange happen. Although I could still ping the device at the original DHCP-set IP address of 192.168.1.5, the web page would not come up. I flailed around for a while (I'm a complete LINUX noob) and figured out that the IP address settings are in /etc/network/interfaces. What I found in that file was maybe a few hundred copies of the following:

allow-hotplug eth0
iface eth0 inet manual
address 192.168.1.40
netmask 255.255.255.0
gateway 192.168.1.1

I looked at the instructions on http://www.cyberciti.biz/faq/linux-conf ... -tutorial/ and changed
iface eth0 inet manual
to
iface eth0 inet static

and deleted all of the extra copies of

allow-hotplug eth0
iface eth0 inet manual
address 192.168.1.40
netmask 255.255.255.0
gateway 192.168.1.1

and rebooted. I was then able to get the ADT2PI Network Appliance to bring up its web page at 192.168.1.40.
Last edited by CF86336 on Wed Oct 21, 2015 6:16 pm, edited 1 time in total.
CF86336
newt
newt
 
Posts: 10
Joined: Mon Oct 19, 2015 7:11 pm

Re: Problem trying to set static IP address

Postby kevin » Tue Oct 20, 2015 9:35 am

Thanks for the report, will put this on the todo list of things to look at in the code, glad you got it working
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Problem trying to set static IP address

Postby CF86336 » Wed Oct 21, 2015 5:05 am

Oddly enough, when I look at the Host Settings page on my ADT2PI WEB Applicance, I now see two sets of IPV4 addresses--one which I set using /etc/network/interfaces, and another that was set when I first brought the Appliance online and it was set up to use DHCP. Don't know how to get rid of the second set of addresses, and would appreciate some help with that.

What I see is something like:
broadcast: xxx.xxx.xxx.xxx (can't remember exactly what it is, and can't access it right now)
netmask: 255.255.255.0
addr: 192.168.1.40 (which I set in /etc/network/interfaces as the static IP address)
broadcast: xxx.xxx.xxx.xxx
netmask: 255.255.255.0
addr: 192.168.1.5 (which was assigned by my Verizon FiOS router when I first brought the Appliance online)

And it seems like I can access the Appliance at both 192.168.1.5 and at 192.168.1.40 on my home LAN.
CF86336
newt
newt
 
Posts: 10
Joined: Mon Oct 19, 2015 7:11 pm

Re: Problem trying to set static IP address

Postby kevin » Wed Oct 21, 2015 9:04 am

If you login to the shell and issue the "ifconfig" command, it should show you exactly what addresses are bound to your pi - if both addresses are bound to your pi, I suggest taking a look at the /etc/network/interfaces file and verify that dhcp is indeed turned off
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Problem trying to set static IP address

Postby CF86336 » Wed Oct 21, 2015 6:13 pm

The following illustrates the problem:

pi@alarmdecoder ~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8:27:eb:6c:3e:21 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.40/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.1.5/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever


The following three commands turn off DHCP and delete the extra IPV4 address: (from the second answer at http://raspberrypi.stackexchange.com/qu ... -come-from )
sudo update-rc.d dhcpcd disable
sudo service dhcpcd stop
sudo ip addr del 192.168.1.5/24 dev eth0

And this is the result after rebooting the Appliance:
pi@alarmdecoder ~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8:27:eb:6c:3e:21 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.40/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
pi@alarmdecoder ~ $

Well, this beats putting together my wife's new vanity for the powder room...
:mrgreen:
Last edited by CF86336 on Thu Oct 22, 2015 9:51 am, edited 1 time in total.
CF86336
newt
newt
 
Posts: 10
Joined: Mon Oct 19, 2015 7:11 pm

Re: Problem trying to set static IP address--SOLVED! (I thin

Postby kevin » Wed Oct 21, 2015 7:10 pm

Sorry you had these issues, but I am glad you are having fun tinkering. That's part of the charm of our product - it's open source and fully modifiable by the user - so when these do come up, you don't exactly have to wait on us - the system is open! There's lots of cool things you can do with the network appliance!
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am


Return to General

Who is online

Users browsing this forum: No registered users and 30 guests

cron