श्री Yogesh Ashok Powar

Personal Blogs

Systemd, wifi and Debian

About configuring WiFi on Debian GNU Linux

Systemd, wifi and Debian

systemd gets the control from the Linux kernel on boot for managing services on the GNU/Linux system.

Configuring Wi-Fi on Debian GNU/Linux system could be tricky.

Following steps worked for my system

$ cat /etc/issue
Debian GNU/Linux 11 \n \l
$
$ iw dev | grep Interface
        Interface wlp4s0
$
$ cat /etc/network/interfaces | grep wlp4s0 | grep -v ^#
$
$ pwd
/etc/systemd/network
$ cat wlan.network
[Match]
Name=wlp4s0

[Network]
DHCP=ipv4
$
$ cat /lib/systemd/system/wpa_supplicant-nl80211@.service
[Unit]
Description=WPA supplicant daemon (interface- and nl80211 driver-specific
version)
Requires=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
Before=network.target
Wants=network.target

# NetworkManager users will probably want the dbus version instead.

[Service]
Type=simple
ExecStart=/sbin/wpa_supplicant
-c/etc/wpa_supplicant/wpa_supplicant-nl80211-%I.conf -Dnl80211 -i%I

[Install]
Alias=multi-user.target.wants/wpa_supplicant-nl80211@%i.service
$
$ cat /etc/wpa_supplicant/wpa_supplicant-nl80211-wlp4s0.conf  | grep -v ^#
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
ctrl_interface_group=0
update_config=1
network={
    ssid="FreeVirus"
    scan_ssid=1
    key_mgmt=WPA-PSK
    psk="n0Vacc1ne4Th1s"
}
$
systemct enable systemd-networkd.service
systemctl enable systemd-resolved.service
systemctl enable wpa_supplicant-nl80211@wlp4s0.service