> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytejmp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WPA / WPA2 PSK

> Connect to WPA and WPA2 personal networks using wpa_supplicant with a pre-shared key.

## Config File

`wpa2.conf`:

```
network={
    ssid="NETWORK-NAME"
    psk="password"
    scan_ssid=1
    key_mgmt=WPA-PSK
    proto=WPA2
}
```

`proto` options:

| Value  | Protocol    |
| ------ | ----------- |
| `WPA`  | WPA (TKIP)  |
| `WPA2` | WPA2 (CCMP) |

***

## Connect

Stop monitor mode first if active:

```bash theme={"dark"}
sudo airmon-ng stop wlan0mon
```

Connect:

```bash theme={"dark"}
sudo wpa_supplicant -Dnl80211 -i <INTERFACE> -c wpa2.conf
```

Get an IP address:

```bash theme={"dark"}
sudo dhclient <INTERFACE> -v
```
