Bring up wireless interfaces

  • In this section, you are going to learn

  • How to bring up wireless interfaces

#

Version

Ubuntu

Ubuntu 22.04 64 bit

Linux Kernel

6.5.0

Supplicant

wpa_supplicant 2.10

Hostapd

hostapd 2.10

test:~$ cd $HOME

test:~$ rm -rf hostap* wpa_supp*
  • Make sure internet is available in laptop to download libraries

test:~$ sudo apt install libnl-genl-3-dev libnl-3-dev libdbus-glib-1-dev
  • Internet is cut-off after this !

  • Stop any active wifi services

test:~$ sudo killall wpa_supplicant

test:~$ sudo killall wpa_cli

test:~$ sudo killall hostapd

test:~$ sudo killall hostapd_cli
  • Stop any active networking services

test:~$ sudo killall dhclient

test:~$ sudo systemctl stop NetworkManager.service
  • Make sure Radio chips are in active state

test:~$ sudo rfkill unblock all

test:~$ sudo rfkill list all
9: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
10: phy1: Wireless LAN
        Soft blocked: no
        Hard blocked: no
11: phy2: Wireless LAN
        Soft blocked: no
        Hard blocked: no
  • Make sure the Wi-Fi network interfaces are UP !

  • Bring up wlan1 interface for station

test:~$ sudo ifconfig wlan1 up
  • Bring up wlan0 interface for ap

test:~$ sudo ifconfig wlan0 up
  • Make sure mode is set to managed in wlan1 interface

test:~$ sudo iwconfig wlan1
wlan1     IEEE 802.11  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
  • Make sure mode is set to managed in wlan0 interface

test:~$ sudo iwconfig wlan0
wlan0     IEEE 802.11  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
test:~$ sudo ifconfig wlan1
wlan1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 02:00:00:00:01:00  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

test:~$ sudo ifconfig wlan0
wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 02:00:00:00:00:00  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