LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2017, 08:12 PM   #1
wBB
LQ Newbie
 
Registered: Jan 2017
Posts: 25

Rep: Reputation: Disabled
IP changes when device restarts


Hi!
I have worked with the 8.6 Linux Debian distribution on a device called BeagleBone Black (also called BBB), in which I need to set up a fixed IP. I already managed to set up, but when the BBB is restarted, the IP goes back to the old number.

I am doing this:

1- Connect the BBB physically to the router;
2 - I verified by the router which dynamic IP the BBB got and then access as root user via SSH in a terminal (like Putty);
3- I edit the file "/etc/network/interfaces" and enter the information I need, like this:
Code:
#Interface Eth0
auto eth0
iface eth0 inet static
network 192.168.0.0
address 192.168.0.15
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
dns-server 192.168.0.1
4- I edit the file "/etc/resolv.conf" and change the "nameserver" to "nameserver 192.168.0.1" (this is the IP of my router)
5- After this I reboot the network: /etc/init.d/networking restart

So far so good! I can access the BBB through the new IP 192.168.0.15 (this is the IP that I chose).

THE PROBLEMS ARE:
When the BBB is turned OFF and ON again, this occurs:
A) The BBB again picks up a dynamic IP from the router;
B) The file "/etc/resolv.conf" returns to its original configuration, which is "nameserver 127.0.0.1".

The file "/etc/network/interfaces" remains with the information I put in, but it's as if it has no effect.

I have already verified a lot of information about the same problems, but maybe because of my lack of knowledge I was unable to solve the problem, although I have tried several alternatives.

I need this IP to stay fixed. I need to turn OFF the BBB, disconnect from the router and connect via CROSS cable to my laptop.

Does anyone have an idea how to solve it?

Last edited by wBB; 01-18-2017 at 08:17 PM.
 
Old 01-18-2017, 08:38 PM   #2
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 4,132

Rep: Reputation: 726Reputation: 726Reputation: 726Reputation: 726Reputation: 726Reputation: 726Reputation: 726
Is that your entire working file, or are there some other active entries present?
 
Old 01-18-2017, 08:58 PM   #3
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 4,132

Rep: Reputation: 726Reputation: 726Reputation: 726Reputation: 726Reputation: 726Reputation: 726Reputation: 726
A bit more searching and I've found references (concerning Debian Jessie) that suggest configuring /etc/dhcpcd.conf instead.

For example
https://nebulousthinking.wordpress.c...essie-in-2016/

Quote:
If you want the static IP to happen on your Ethernet (hard-wired) network connection, then add lines like this to the top of the file – before the first comment:
Code:
interface eth0
static ip_address=192.168.0.15/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
Another example of this..
http://superuser.com/questions/54711...pcd-still-runs
 
Old 01-20-2017, 01:46 PM   #4
wBB
LQ Newbie
 
Registered: Jan 2017
Posts: 25

Original Poster
Rep: Reputation: Disabled
ferrari,
there is no "dhcpcd.conf" file at this Linux Debian distribution.
So the two examples you indicated do not solve the problem in this case.
PS: I have very little knowledge about Linux, so if you have a little more patience and help me a bit more, I would be very grateful!
 
Old 01-20-2017, 08:33 PM   #5
wBB
LQ Newbie
 
Registered: Jan 2017
Posts: 25

Original Poster
Rep: Reputation: Disabled
SOLUTION:

It had nothing to do with anything that was quoted. It occurs in Debian Linux, of several versions (mine is Jessie 8.6), there is a connection management package that overwrites some information and simply ignores others, such as the file information "interfaces" I mentioned above. This management pack is called "connman" and can be verified at the debian.org site at the address below:
https://packages.debian.org/search?keywords=connman

HOW TO KEEP FIXED IP ON DEBIAN JESSIE:

1- Edit the file "/etc/network/interfaces" and add (or edit) at the end of file, the lines below, adapting the information of your network or a fictitious network, at your discretion:
Code:
#Interface Eth0
auto eth0
iface eth0 inet static
network 192.168.0.0
address 192.168.0.15
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
dns-server 192.168.0.1
2- Edit the file "/etc/resolv.conf" and change the "nameserver". In my case I put the IP of my router and another one:
nameserver 192.168.0.1
nameserver 8.8.8.8

3- Locate the "connman" service. Make sure what name it takes on your Linux distribution. In my case it was "connman" anyway. To list the services running: ps -aux

4. Uninstall the "connman" service: apt-get purge connman

5. Restart Linux: reboot.

That way my device still worked connected to the router, being possible to access it by IP 192.168.0.15, which was the IP that I chose. But it is also possible to access directly through a cable connected between the device and the laptop.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Restarts after shutdown!? irajjs Mandriva 5 07-28-2012 06:33 PM
Server restarts on his own ticoloco Linux - Server 11 10-11-2010 10:48 AM
Locks up and Restarts NetKatz Mandriva 9 09-07-2007 11:19 PM
Computer restarts after syslogd restarts birdseye Linux - General 2 03-05-2006 05:27 AM
Still X Random restarts redhatnoob Linux - General 2 02-17-2004 05:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration