Managed mode w/ WPA supplicant

assuming you found a few masters

THE EASY WAY

use debian’s network setup

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid {ssid}
    wpa-psk  {password}

THE HARD WAY

take a pick

WPA-PSK/TKIP
WPA2-EAP/CCMP using EAP-TLS
IEEE 802.1X with dynamic WEP keys using EAP-PEAP/MSCHAPv2

WPA-PSK/TKIP

# ubuntu
cp /usr/share/doc/wpa_supplicant/examples/wpa-psk-tkip.conf /etc/wpa.conf
chmod 600 /etc/wpa.conf
wpa_passphrase SSID PASSPHRASE
vi /etc/wpa.conf

comment out ctrl_interface and change ssid/psk

network={
        ssid="SSID-HERE"
        key_mgmt=WPA-PSK
        proto=WPA
        pairwise=TKIP
        group=TKIP
        psk="GENERATED-PSK-HERE"
}

WPA2 CCMP PSK

network={
    ssid="SSID-HERE"
    key_mgmt=WPA-PSK
    proto=WPA2
    psk="GENERATED-PSK-HERE"
}

WPA2-EAP/CCMP using EAP-PEAP

Mixing two example configurations (Ubuntu)

# WPA2-EAP/CCMP using EAP-TLS
cat /usr/share/doc/wpa_supplicant/examples/wpa2-eap-ccmp.conf

# IEEE 802.1X with dynamic WEP keys using EAP-PEAP/MSCHAPv2
cat /usr/share/doc/wpa_supplicant/examples/ieee8021x.conf

EAP-PEAP not EAP-TLS

vi /etc/wpa.conf

ctrl_interface=/var/run/wpa_supplicant

network={
    ssid="SSID-HERE"
    key_mgmt=WPA-EAP
    proto=WPA2
    pairwise=CCMP
    group=CCMP
    eap=PEAP
    identity="USER-HERE"
    password="PASSWORD-HERE"
}

and eventually

    eap=PEAP
        phase2="auth=MSCHAPV2"

Ready to go

we are doing it manually, no need for the daemon

systemctl stop wpa_supplicant
systemctl disable wpa_supplicant

check that you wireless interface gets Associated and that you get a DHCP lease

wpa_supplicant -h
wpa_supplicant -i wlan0 -c /etc/wpa.conf &
ls -lF /var/run/wpa_supplicant/*
iwconfig wlan0
dhclient -v wlan0
ifconfig wlan0
ls -lF /etc/resolv.conf
resolvectl status | grep Server

in case you wanna sniff

ifconfig wlan0 promisc

release the lease and terminate the session

dhclient -r wlan0
fg
^C

then eventually enable the WPA client at boot-time while using syslog instead

#tail -F /var/log/kern.log /var/log/syslog
wpa_supplicant -i wlan0 -c /etc/wpa.conf -s -B

Ad-hoc mode

we can also have a look at the ad-hoc cells,

draft, only the ad-hoc interface can see itself – why?

ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 channel X

ifconfig wlan0 up
iwlist wlan0 scan
iwconfig wlan0 rate 54Mb/s
iwconfig wlan0 essid 'ESSID'
ifconfig wlan0 x.x.x.x/xx up

Resources

CCMP (cryptography) https://en.wikipedia.org/wiki/CCMP_(cryptography)

WPA supplicant https://wiki.archlinux.org/index.php/WPA_supplicant

wpa_supplicant https://wiki.gentoo.org/wiki/Wpa_supplicant

Using WPA_Supplicant to Connect to WPA2 Wi-fi from Terminal on Ubuntu 16.04 Server https://www.linuxbabe.com/command-line/ubuntu-server-16-04-wifi-wpa-supplicant

Configuring WPA2 using wpa_supplicant on the Raspberry Pi https://kerneldriver.wordpress.com/2012/10/21/configuring-wpa2-using-wpa_supplicant-on-the-raspberry-pi/

Example wpa_supplicant configuration file https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf https://www.cs.upc.edu/lclsi/Manuales/wireless/files/wpa_supplicant.conf

EAP

Connect to a WPA2 Enterprise network with wpa_supplicant https://gist.github.com/kyleraymorgan/fb404500adafe1ebdb66

802.1x/radius https://wiki.archlinux.org/index.php/WPA_supplicant#802.1x/radius

ad-hoc

Mobile Ad Hoc Networking https://books.google.ru/books?id=GnkcHEsxAigC (&hl=en)

bssid

https://askubuntu.com/questions/887676/connect-to-wireless-ap-by-mac-address

https://superuser.com/questions/1075776/connect-wlan-interface-to-specific-bssid-without-knowledge-about-ssid


GUIDES | LECTURES | BENCHMARKS | SMTP HEALTH