Jessie WIFI client: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
Line 19: Line 19:
</source>
</source>


Now enable the service to start up automatically:
Now enable the service to start up on boot:
systemctl enable wpa_supplicant@wlan0
systemctl enable wpa_supplicant@wlan0



Revision as of 15:52, 10 February 2017

If you're using a WPA/WPA2 network, first create your wpa_supplicant config:

wpa_passphrase yournetwork yourpassword > /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

Now enable the service to start up on boot: systemctl enable wpa_supplicant@wlan0

Create the file /etc/systemd/network/wlan0.network with:

[Match]
Name=wlan0

[Network]
DHCP=yes

See the Networked clients 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 these changes:

systemctl enable wpa_supplicant@wlan0
systemctl start wpa_supplicant@wlan0
systemctl restart systemd-networkd