Load mac80211_hwsim =========================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Version Info ` * :ref:`Load mac80211_hwsim ` * :ref:`STEP 1: Stop existing Wireless Modules ` * :ref:`STEP 2: Insert the modules ` * :ref:`STEP 3: Check the loaded modules ` * :ref:`STEP 4: Check for interface name ` .. _barelinux_x86-64_wi-fi_STA_and_AP_with_mac80211_hwsim_step1_1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow * How to load mac80211_hwsim with 3 radios .. _barelinux_x86-64_wi-fi_STA_and_AP_with_mac80211_hwsim_step1_2: .. tab-set:: .. tab-item:: Version Info =============================== ======================================= # Version =============================== ======================================= Ubuntu Ubuntu 22.04 64 bit Linux Kernel 6.5.0 =============================== ======================================= .. _barelinux_x86-64_wi-fi_STA_and_AP_with_mac80211_hwsim_step1_3: .. tab-set:: .. tab-item:: How to load mac80211_hwsim .. _barelinux_x86-64_wi-fi_STA_and_AP_with_mac80211_hwsim_step1_4: .. tab-set:: .. tab-item:: STEP 1: Stop existing Wireless Modules * Stop applications by running the commands below: .. code-block:: shell test:~$ pwd /home/test test:~$ sudo systemctl stop NetworkManager.service test:~$ sudo killall wpa_supplicant hostapd test:~$ ps -N | grep -i wpa_supplicant test:~$ ps -N | grep -i hostapd * Now, remove drivers by executing rmmod command as shown below: .. code-block:: shell test:~$ sudo rmmod mac80211_hwsim test:~$ sudo rmmod mac80211 test:~$ sudo rmmod libarc4 test:~$ sudo rmmod lib80211 test:~$ sudo rmmod cfg80211 .. _barelinux_x86-64_wi-fi_STA_and_AP_with_mac80211_hwsim_step1_5: .. tab-set:: .. tab-item:: STEP 2: Insert the modules .. code-block:: shell test:~$ sudo insmod /lib/modules/$(uname -r)/kernel/net/wireless/cfg80211.ko test:~$ sudo insmod /lib/modules/$(uname -r)/kernel/net/wireless/lib80211.ko test:~$ sudo insmod /lib/modules/$(uname -r)/kernel/lib/crypto/libarc4.ko test:~$ sudo insmod /lib/modules/$(uname -r)/kernel/net/mac80211/mac80211.ko test:~$ sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/virtual/mac80211_hwsim.ko radios=3 .. _barelinux_x86-64_wi-fi_STA_and_AP_with_mac80211_hwsim_step1_6: .. tab-set:: .. tab-item:: STEP 3: Check the loaded modules .. code-block:: shell test:~$ lsmod Module Size Used by mac80211_hwsim 122880 0 mac80211 1720320 1 mac80211_hwsim libarc4 12288 1 mac80211 lib80211 16384 0 cfg80211 1323008 2 mac80211_hwsim,mac80211 .. _barelinux_x86-64_wi-fi_STA_and_AP_with_mac80211_hwsim_step1_7: .. tab-set:: .. tab-item:: STEP 4: Check the output of iwconfig command * Check if 3 wlan interfaces are created * wlan0 will be used for ap * wlan1 will be used for station * wlan2 will be used as monitor mode to capture packets between station and ap .. code-block:: shell test:~$ iwconfig 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 Power Management:off 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 Power Management:off wlan2 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 Power Management:off