2

I have tried using this guide: https://wireless.wiki.kernel.org/en/users/drivers/mac80211_hwsim

and did

modprobe mac80211_hwsim

However the output is:

modprobe: FATAL: Module mac80211_hwsim not found in directory /lib/modules/...

How do I get it?

Moab
  • 58,044
  • 21
  • 113
  • 176

3 Answers3

1

Seems like the kernel you are running isn't compliled with mac80211_hwsim.

You need to install another one, compile it with it, and install it.

If you have ubuntu you can use that guide:

https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel

When it says "Modifying the configuration" add a CONFIG_MAC80211_HWSIM flag in the .conf or using make menuconfig

After you finish the installation reboot into the new kernel (choose it in grub), then you can modprobe mac80211_hwsim.

dani39
  • 26
  • 2
  • 1
    Can I avoid using another kernel? –  Jan 25 '20 at 16:15
  • 1
    you can compile the same kernel version you have, than insmod mac80211_hwsim manually from the compiled kernel folder. –  Jan 25 '20 at 16:17
  • 1
    I have moved to another pc in the meantime, after modprobing hwsim I can't seem to run hostapd the wlan0 it creates, it says it can't do "UP", I'm running as root, any idea why? –  Jan 25 '20 at 16:25
  • Maybe it is the network-manager, try sudo service network-manager stop –  Jan 25 '20 at 16:26
  • This is marked as solution, did it work? – Moab Jan 25 '20 at 17:14
  • 1
    Yes, it did, I have actually used the same kernel version, so I just insmoded the module after re-compiling the kernel with the flag (I was already running on my own compiled kernel), without having to reboot into another kernel. – money-for-nothing Jan 25 '20 at 17:20
0

You can check whether mac80211_hwsim code compiled or not watching to your config (according to uname -r) such way:

grep HWSIM /boot/config-*

If your kernel configured with CONFIG_MAC80211_HWSIM=n this code is not compiled and you can't use it without recompiling. If you have CONFIG_MAC80211_HWSIM=m it is compiled as module (seems it's not your case). Also it can be configured as CONFIG_MAC80211_HWSIM=y - this code is already built in your kernel, so you don't need to do modprobe or insmod.

red0ct
  • 214
  • 2
  • 10
0

In latest Ubuntu I solved this by installing the package linux-modules-extra-{KERNEL_VERSION}-generic where this modules resides.

jon
  • 1
  • 1