# WiFi USB

For this step we need internet connection. Make sure that the raspberry is connected with an ethernet cable.

Check with `ifconfig` available connectons

```
$ ifconfig -a
...
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 
       ether b0:a7:b9:ce:d3:58 txqueuelen 1000 (Ethernet)
       RX packets 0 bytes 0 (0.0 B)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 0 bytes 0 (0.0 B)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
```

We observe that there is no IP associated to `wlan0` interface. Let' change that. Run the following command and copy it to the clipboard.

```
$ wpa_passphrase [SSID] [SSID_PASSWORD]
```

where `SSID` and `SSID_PASSWORD` are the network name and password, respectively. Then open the file `wpa_supplicant.conf`&#x20;

```
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
```

and paste the content at the end. Also, add four additonal fields. At the end you should have somethng like below:

{% code title="/etc/wpa\_supplicant/wpa\_supplicant.conf" %}

```
network={
        ssid=[SSID]
        psk=[SSID_PASSWORD_PSK]
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        group=CCMP
}
```

{% endcode %}

Finally, reboot the raspberry and it should connect to the network by default.

```
$ sudo reboot
```

{% hint style="info" %}
[*How to Set Up a USB Wi-Fi Adapter With the Raspberry Pi*](https://www.lifewire.com/usb-wifi-adapter-raspberry-pi-4058093)*,* lifewire.com, August 25th 2021
{% endhint %}

## Additionally

You can set a static IP this wirelessconnectin, just as you dit with the wire d connection in section [Set static IP](https://notes.lcsrg.me/home-setup/raspberry/untitled).
