- Use
ip link
to find the name of your wifi interface. Common names include wlan0
, wlp2s0
, wlx00e04c361e2
, etc.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
- Now, knowing the wifi interface's name, scan the available WiFi networks:
iw dev <your_wifi_interface> scan
- Connect to WiFi:
iw dev <your_wifi_interface> connect <SSID> key <passphrase>
- Obtain IP Address (if needed):
dhclient <your_wifi_interface>