Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
victorhooi
Posts: 7
Joined: 2008-02-29 08:44

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

#1 Post by victorhooi »

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?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#2 Post by Head_on_a_Stick »

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).
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

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

#3 Post by stevepusser »

If you're lazy, you could also try the CLI version of network-manager or wicd.
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#4 Post by Head_on_a_Stick »

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
deadbang

Post Reply