The officially official Devuan Forum!

You are not logged in.

#1 2024-07-09 17:13:15

Registered: 2024-07-09
Posts: 1  

Dhcpdiscover freezes boot, when there is no wifi network

Hello! I use Devuan and sysVinit. I often use different networks and sometime switch to smartphone's hotspot. This is how I typed my extra simple config, cat /etc/network/interfaces

#wifi with wlan0 to Xiaomi Redmi
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
	wpa-ssid Redmi
	wpa-proto WPA2
	wpa-key-mgmt WPA-PSK
	wpa-psk mykeyheremykeyhere

This connects me to my smartphones network. But if I reboot and switch off my smartphone's hotspot (for example next day, when I just came to work), my Devuan stops booting because of DHCPDISCOVER that waiting network with continuing delays. This is awful, I wish first start X-server and Slim for type my username and pass and only after that start networking and DHCP. Could you advise something? How to move start of networking after start of Slim?


#2 2024-07-09 20:43:49

From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,190  

Re: Dhcpdiscover freezes boot, when there is no wifi network

You might want to use the following setup variant:
First, create or edit  /etc/wpa_supplicant/wpa_supplicant.conf to have 2 initial lines like this:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Secondly, change /etc/network/interfaces for wlan0 to read like this

auto wlan0
iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Thirdly, add the user to the group netdev.

Then that user can operate the wlan0 connection with wpagui (which you might need to install), and all details for networks that they connect to gets saved in /etc/wpa_supplicant/wpa_supplicant.conf, to be autimatically re-used upon roaming... (it's also possble for you to enter that beforehand with a text editor, but the file is also updated by wpa_supplicant. See man wpa_action for details).

EDIT: Note that there are two iface blocks for wireless in this setup. Firstly the wlan0 block that registers it to wpa_supplicant via the wpa_roam setting, telling the name of the connection database file to use. Secondly a default block that wpa_action uses for configuring the interface. Note that "default" is the name of that block.

EDIT 2: Technically this solves the issue of running a dhcp attempt too early to the wrong network by  the wireless setup being broken up into two phases. The first phase happens on boot, where the interface is brought up to link level. That enables wpa_supplicant to scan for available networks. The interface is thereafter raised to ip level when wpa_supplicant discovers a network it has connection details for, and then dhcp is used (as configured by the default iface block) with the approrpiate link encryption for aquiring the network address(s) etc.

This setup also allows for static (rather than dhcp) network configurations to be made for individual networks. You do that by other specially named iface blocks to identify the concerned connections. See the man page if you need that.


Board footer