Changes

Jump to: navigation, search

XUELK-AN-002: Running Debian distribution

1,485 bytes added, 17:34, 20 March 2017
WiFi (client mode)
</pre>
Add the passphrase key to the <code>wpa_supplicant</code> configration file:<pre class="board-terminal">
root@arm:~# wpa_passphrase SSID_ZyXEL_WPA2 >> /etc/wpa_supplicant.conf
ZyXEL-WPA2-PSK
psk=ec41b79ebdf10022908aa10189b0341f095fd62eeb719a67c5c920e0cde28564
}
</pre>
 
Start <code>wpa_supplicant</code>:
<pre class="board-terminal">
root@arm:~# wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
[ 3527.349780] wlan0: associated
[ 3527.352824] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
</pre>
Once the connection process completed successfully, <code>iw</code> reports the link status as follows:
<pre class="board-terminal">
root@arm:~# iw wlan0 link
Connected to fe:f0:28:cc:03:90 (on wlan0)
dtim period: 1
beacon int: 100
</pre>
 
It is possible to modify <code>/etc/networks/interfaces</code> in order to automatically start and configure the WiFi interface on every boot. The following example shows a configuration with static IP addresses. The <code>wpa-psk</code> string is retrieved from the <code>/etc/wpa_supplicant.conf</code> file.
<pre class="board-terminal">
root@arm:/etc/network# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d
auto eth0
 
##########################################
# Ethernet
# - static configuration
iface eth0 inet static
address 192.168.0.81
netmask 255.255.255.0
gateway 192.168.0.254
# - DHCP configuration
#allow-hotplug eth0
#iface eth0 inet dhcp
 
##########################################
# WiFi
# - static configuration
auto wlan0
iface wlan0 inet static
address 192.168.11.81
netmask 255.255.255.0
network 192.168.11.0
broadcast 192.168.11.255
gateway 192.168.11.243
dns-nameservers 192.168.0.1, 8.8.8.8
wpa-ssid SSID_ZyXEL_WPA2
wpa-psk ec41b79ebdf10022908aa10189b0341f095fd62eeb719a67c5c920e0cde28564
</pre>
4,650
edits

Navigation menu