Jessie WIFI client: Difference between revisions
From embeddedTS Manuals
(Added clarifications) |
(Removed command repeated twice. Cleaned up formatting slightly.) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 18: | Line 18: | ||
[Install] | [Install] | ||
Alias=multi-user.target.wants/wpa_supplicant@%i.service | Alias=multi-user.target.wants/wpa_supplicant@%i.service | ||
</source> | </source> | ||
Line 35: | Line 29: | ||
DHCP=yes | DHCP=yes | ||
</source> | </source> | ||
See the [[#Debian_Networking|systemctl-networkd]] example for setting a static IP for a network interface. The wlan0.network can be configured the same way as an eth.network. | |||
To enable all of the changes that have been made, run the following commands: | |||
<source lang=bash> | <source lang=bash> | ||
systemctl enable wpa_supplicant@wlan0 | systemctl enable wpa_supplicant@wlan0 |
Latest revision as of 14:31, 8 December 2017
If connecting to a WPA/WPA2 network, a wpa_supplicant config file must first be created:
wpa_passphrase yournetwork yournetworkpassphrase > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
Create the file /lib/systemd/system/wpa_supplicant@.service with these contents
[Unit]
Description=WPA supplicant daemon (interface-specific version)
Requires=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
Type=simple
ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
[Install]
Alias=multi-user.target.wants/wpa_supplicant@%i.service
Create the file /etc/systemd/network/wlan0.network with:
[Match]
Name=wlan0
[Network]
DHCP=yes
See the systemctl-networkd example for setting a static IP for a network interface. The wlan0.network can be configured the same way as an eth.network.
To enable all of the changes that have been made, run the following commands:
systemctl enable wpa_supplicant@wlan0
systemctl start wpa_supplicant@wlan0
systemctl restart systemd-networkd