Jessie WIFI client: Difference between revisions
From embeddedTS Manuals
No edit summary |
(Removed command repeated twice. Cleaned up formatting slightly.) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
If | 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 | 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> | ||
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. | |||
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