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 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? |
Is that your entire working file, or are there some other active entries present?
|
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:
http://superuser.com/questions/54711...pcd-still-runs |
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! |
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 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. |
All times are GMT -5. The time now is 12:41 PM. |