Jessie WIFI client: Difference between revisions

From embeddedTS Manuals
(Created page with "If you're using a WPA/WPA2 network, first create your wpa_supplicant config: <source lang=bash> wpa_passphrase yournetwork yourpassword > /etc/wpa_supplicant/wpa_supplicant-wl...")
 
(Removed command repeated twice. Cleaned up formatting slightly.)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
If you're using a WPA/WPA2 network, first create your wpa_supplicant config:
If connecting to a WPA/WPA2 network, a wpa_supplicant config file must first be created:
<source lang=bash>
<source lang=bash>
wpa_passphrase yournetwork yourpassword > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
wpa_passphrase yournetwork yournetworkpassphrase > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
</source>
</source>


Create the file /lib/systemd/system/wpa_supplicant@.service with these contents
Create the file /lib/systemd/system/wpa_supplicant@.service with these contents
Line 19: Line 20:
</source>
</source>


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


Create the file /etc/systemd/network/wlan0.network with:
Create the file /etc/systemd/network/wlan0.network with:
Line 30: 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. 


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:
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 start wpa_supplicant@wlan0
systemctl start wpa_supplicant@wlan0
systemctl restart systemd-networkd  
systemctl restart systemd-networkd  
</source>
</source>

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