Jessie WIFI client: Difference between revisions

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


Next, enable the service to start up on boot:
<source lang=bash>
systemctl enable wpa_supplicant@wlan0
</source>
Create the file /etc/systemd/network/wlan0.network with:
<source lang=bash>
[Match]
Name=wlan0
[Network]
DHCP=yes
</source>
Enable networkd to manage this interface.
<source lang=bash>
If connecting to a WPA/WPA2 network, a wpa_supplicant config file must first be created:
<source lang=bash>
wpa_passphrase yournetwork yournetworkpassphrase > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
</source>
Create the file /lib/systemd/system/wpa_supplicant@.service with these contents
<source lang=bash>
[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
</source>


Next, enable the service to start up on boot:
Next, enable the service to start up on boot:
Line 25: Line 61:
systemctl enable wpa_supplicant@wlan0
systemctl enable wpa_supplicant@wlan0
</source>
</source>


Create the file /etc/systemd/network/wlan0.network with:
Create the file /etc/systemd/network/wlan0.network with:
Line 36: Line 71:
</source>
</source>


Enable networkd to manage this interface on startup.
<source lang=bash>
systemctl enable systemd-networkd
</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:
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:

Revision as of 11:31, 28 September 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

Next, 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

Enable networkd to manage this interface.

If connecting to a WPA/WPA2 network, a wpa_supplicant config file must first be created:
<source lang=bash>
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

Next, 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

Enable networkd to manage this interface on startup.

systemctl enable systemd-networkd

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