# Wifi on the Antsle Nano

{% hint style="info" %}
Setting up WiFi on the nano works and allows you to use the connection on a system level. However, it does not work as Interface in antMan, i.e. cannot be used to configure a bridged NIC. Since WiFi is generally less reliable and slower than Ethernet, it is generally not advised to use it.
{% endhint %}

You can easily configure a WiFi connection on the Antsle Nano using [wpa\_supplicant](https://linux.die.net/man/8/wpa_supplicant), which should be pre-installed on your Antsle Nano,  follow the steps below on the command line.

1. Edit `/etc/wpa_supplicant/wpa_supplicant.conf` and add a `network={…}` block to it.

Example:

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
   ssid="MyNetwork"
   scan_ssid=1
   key_mgmt=WPA-PSK
   psk="topsecret"
}
```

| Field      | Description                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ssid       | Network name (as announced by the access point). An ASCII or hex string enclosed in quotation marks.                                                                                                                                                                                                                                                                                                                            |
| ssid\_scan | SSID scan technique; 0 (default) or 1. Technique 0 scans for the SSID using a broadcast Probe Request frame while 1 uses a directed Probe Request frame. Access points that cloak themselves by not broadcasting their SSID require technique 1, but beware that this scheme can cause scanning to take longer to complete.                                                                                                     |
| key\_mgmt  | <p>List of acceptable key management protocols; one or more of:</p><p>             WPA-PSK (WPA pre-shared key), WPA-EAP (WPA using EAP</p><p>             authentication), IEEE8021X (IEEE 802.1x using EAP authentication</p><p>             and, optionally, dynamically generated WEP keys), NONE (plaintext</p><p>             or static WEP keys).  If not set this defaults to "WPA-PSK</p><p>             WPA-EAP".</p> |
| psk        | WPA preshared key used in WPA-PSK mode.  The key is specified as 64 hex digits or as an 8-63 character ASCII passphrase.  ASCII passphrases are converted to a 256-bit key using the network SSID by the wpa\_passphrase utility.                                                                                                                                                                                               |

2\. Edit `/etc/sysconfig/wpa_supplicant` to make sure you add `-iwlan0` to specify the correct interface.

```
# Use the flag "-i" before each of your interfaces, like so:
#  INTERFACES="-ieth1 -iwlan0"
INTERFACES="-iwlan0"
# Use the flag "-D" before each driver, like so:
#  DRIVERS="-Dwext"
DRIVERS=""
# Other arguments
#   -u   Enable the D-Bus interface (required for use with NetworkManager)
#   -f   Log to /var/log/wpa_supplicant.log
#   -P   Write pid file to /var/run/wpa_supplicant.pid 
#        required to return proper codes by init scripts (e.g. double "start" action)
#        -B to daemonize that has to be used together with -P is already in wpa_supplicant.init.d
OTHER_ARGS="-P /var/run/wpa_supplicant.pid"
```

{% hint style="info" %}
The third line `INTERFACES="-iwlan0"` is the one that needs to be updated. If it is commented, uncomment that line.
{% endhint %}

3\. Restart the service by running `systemctl restart wpa_supplicant.service` .

4\. Run `wpa_cli -i wlan0` to start the wpa\_supplicant cli in interactive mode.

5\. Run `interface wlan0` in the wpa\_cli prompt.

6\. Wait a few seconds and check the status by running `status` at the wpa\_cli prompt. You should see the connection, like below.

```
> status
bssid=58:b6:33:7b:0c:6c
freq=5600
ssid=MyNetwork
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
p2p_device_address=06:26:15:88:c9:22
address=c2:11:c6:b8:6e:9d
uuid=ca4813d9-409d-5033-8307-28cbc1b82b34
```

7\. Type `q` to quit `wpa_cli` .

You can now use the `wlan0` interface!

For more information on wpa\_supplicant, please refer to the manpage [here](https://www.daemon-systems.org/man/wpa_supplicant.conf.5.html).
