How to configure Debian to auto-connect to wifi when in rang

Kernels & Hardware, configuring network, installing services

How to configure Debian to auto-connect to wifi when in rang

Postby victorhooi » 2020-06-07 19:49

I have installed a new Debian Bullseye install on a NUC, for headless use. (Not using NetworkManager)

Does anybody know how to configure it from the CLI, to auto-connect to certain WiFi APs when in range?

Reading https://wiki.debian.org/WiFi and https://wiki.debian.org/WiFi/HowToUse.

I have installed the following packages:
  • iw
  • wireless-tools
  • iwd packages
I see there's an allow-hotplug option for /etc/interfaces - but that appears to only check upon boot - not if the network subsequent becomes available.

Does anybody know how to do this?
victorhooi
 
Posts: 7
Joined: 2008-02-29 08:44

Re: How to configure Debian to auto-connect to wifi when in

Postby Head_on_a_Stick » 2020-06-07 20:51

Use this line in the wireless stanza in /etc/network/interfaces instead of the usual wpa-ssid & wpa-psk lines:
Code: Select all
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Then populate /etc/wpa_supplicant/wpa_supplicant.conf with a list of the desired APs using wpa_passphrase(8).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12821
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to configure Debian to auto-connect to wifi when in

Postby stevepusser » 2020-06-08 04:03

If you're lazy, you could also try the CLI version of network-manager or wicd.
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12146
Joined: 2009-10-06 05:53

Re: How to configure Debian to auto-connect to wifi when in

Postby Head_on_a_Stick » 2020-06-08 11:31

IMO using wpa_supplicant requires less effort because all the APs can be configured without having to actually visit them and connect manually.

And if the OP wants to use NetworkManager on a headless box then they will probably prefer the ncurses interface:
Code: Select all
nmtui
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12821
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to System configuration

Who is online

Users browsing this forum: No registered users and 19 guests

fashionable