Adafruit is open, safely ... and shipping all orders at this time! Read more!
0

Debian 8.7 - Configuring network to use DHCP with fallback
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Debian 8.7 - Configuring network to use DHCP with fallback

by smbrandonjr on Sun Nov 18, 2018 10:30 pm

I am refactoring an application for BeagleBone (running Debian 8.7 IoT) I had originally created on a raspberry Pi that was running Raspbian Stretch. One the features of my application is the ability to configure the network settings via a web browser interface. I also have a physical "reset switch" that when held closed for 5 seconds, initiates a reset of the network back to DHCP along with a fallback static IP address. I had all of that working great in Rasbian Stretch but it was built around dhcpcd.

I am about to throw my computer out of the window trying to get this to work on Debian 8.7 on my beaglebone...

My last attempt was to modify the dhclient.conf file adding:

Code: Select all | TOGGLE FULL SIZE
timeout 20;

lease {
  interface "eth0";
  fixed-address 192.168.1.50;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.50;
}


Any ideas?

smbrandonjr
 
Posts: 27
Joined: Thu Oct 11, 2018 12:44 am

Re: Debian 8.7 - Configuring network to use DHCP with fallba

by smbrandonjr on Mon Nov 19, 2018 2:27 pm

I think conman is causing me my issue... I have tried adding eth0 to NetworkInterfaceBlacklist in /etc/connman/main.conf but when I do that and reboot, I am unable to SSH into my BB...and the BB no longer shows up on my network as if DHCP is not working.

smbrandonjr
 
Posts: 27
Joined: Thu Oct 11, 2018 12:44 am

Re: Debian 8.7 - Configuring network to use DHCP with fallba

by smbrandonjr on Mon Nov 19, 2018 3:14 pm

In case anyone stumbles across this post trying to do something similar... I think I am on track with having done the following:

1) Installed dhcpcd5

Code: Select all | TOGGLE FULL SIZE
sudo apt-get install dhcpcd5


This was important to do before step 2 in a headless environment since I relied on SSH for connectivity

2) Add eth0 to NetworkInterfaceBlacklist in conman's main.conf

Code: Select all | TOGGLE FULL SIZE
sudo nano /etc/connman/main.conf


3) At this point I rebooted to confirm that dhcpcd was working for me...yay, it was!

4) Modified /etc/dhcpcd.conf with my fallback info

Code: Select all | TOGGLE FULL SIZE
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
profile static_eth0
static ip_address=192.168.1.50/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8 8.8.4.4

# fallback to static profile on eth0
interface eth0
fallback static_eth0


At this point, I plugged into my beaglebone directly from my laptop via ethernet, rebooted beaglebone, and was able to connect over my fallback IP.

smbrandonjr
 
Posts: 27
Joined: Thu Oct 11, 2018 12:44 am

Re: Debian 8.7 - Configuring network to use DHCP with fallba

by smbrandonjr on Mon Nov 19, 2018 3:43 pm

I also had to modify the /etc/network/interfaces file, otherwise I was getting some inconsistent results...

Code: Select all | TOGGLE FULL SIZE
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

smbrandonjr
 
Posts: 27
Joined: Thu Oct 11, 2018 12:44 am

Re: Debian 8.7 - Configuring network to use DHCP with fallba

by smbrandonjr on Tue Nov 20, 2018 12:33 am

In more news I found that conmand and dhcpcd were writing numerous lines to /var/log/syslog every second.

Had to add can0 and can1 to NetworkInterfaceBlacklist in /etc/connman/main.conf

Had to add denyinterfaces can0 can1 in /etc/dhcpcd.conf

smbrandonjr
 
Posts: 27
Joined: Thu Oct 11, 2018 12:44 am

Re: Debian 8.7 - Configuring network to use DHCP with fallba

by drewfustini on Tue Nov 20, 2018 3:42 am

If this is still an issue, then I would recommend posting on the BeagleBoard.org community mailing list.
http://bbb.io/discuss

Robert Nelson builds the BeagleBoard.org Debian images and provides support there. He does not monitor this forum.

drewfustini
 
Posts: 923
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.