> ## 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.

# WPS

> Connect to WPS-enabled networks using Push Button (PBC) or PIN method via wpa_supplicant and wpa_cli.

## Overview

WPS (Wi-Fi Protected Setup) simplifies connecting to a network without entering a passphrase. Two methods exist: Push Button Configuration (PBC) and PIN entry.

***

## Push Button (PBC)

Physical button on router triggers a 2-minute association window.

**1. Start wpa\_supplicant:**

```bash theme={"dark"}
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
```

**2. Trigger PBC:**

```bash theme={"dark"}
sudo wpa_cli -i wlan0 wps_pbc
```

Press the WPS button on the router within 2 minutes.

**3. Get IP:**

```bash theme={"dark"}
sudo dhclient wlan0 -v
```

***

## PIN Method

**1. Start wpa\_supplicant:**

```bash theme={"dark"}
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
```

**2. Get BSSID of target:**

```bash theme={"dark"}
sudo wpa_cli -i wlan0 scan
sudo wpa_cli -i wlan0 scan_results
```

**3. Connect with PIN:**

```bash theme={"dark"}
sudo wpa_cli -i wlan0 wps_pin <BSSID> <8-DIGIT-PIN>
```

Leave PIN blank to generate one automatically:

```bash theme={"dark"}
sudo wpa_cli -i wlan0 wps_pin <BSSID> any
```

**4. Get IP:**

```bash theme={"dark"}
sudo dhclient wlan0 -v
```

***

## wpa\_supplicant Base Config

Minimal config file needed to run `wpa_supplicant`:

```
ctrl_interface=/run/wpa_supplicant
update_config=1
```

Save as `/etc/wpa_supplicant/wpa_supplicant.conf`.

***

<Note>
  WPS PIN method requires the router to have the Registrar role. Some routers disable PIN after repeated failures (lockout protection).
</Note>
