It’s even a little more complicated.
Loading order of modules seems to be important.
I was hit by this, because of a dependency of a NWM-package which pulled in “xl2tpd”. That package contains a file in “/usr/lib/modules-load.d” which autoloads the respective l2tp modules and even pulls them into to initial ramdisk.
By this, those modules were loaded before cfg80211 and all the other modules needed by my wireless devices and this triggers the strange problem.
So for a real test, you have to take care all of your wireless modules are unloaded before loading “l2tp_netlink”.
I have an Intel Wireless on this machine, so I have to unload “iwldvm”, please adjust this to your hardware.
modprobe -rv iwldvm
rmmod iwldvm
rmmod mac80211
rmmod iwlwifi
rmmod cfg80211
lsmod | grep -E '80211|l2tp'
When loading cfg80211 first and then l2tp_netlink, anything is fine.
modprobe -v cfg80211
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/wireless/cfg80211.ko
modprobe -v l2tp_netlink
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/ipv4/udp_tunnel.ko
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/ipv6/ip6_udp_tunnel.ko
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/l2tp/l2tp_core.ko
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/l2tp/l2tp_netlink.ko
COUNTRY=DE crda ; echo $?
Failed to set regulatory domain: -7
249
and you can change your regulatory domain via “iw reg set $COUNTRYCODE”.
iw reg set US
iw reg get
global
country US: DFS-FCC
(2402 - 2472 @ 40), (N/A, 30), (N/A)
(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
(5735 - 5835 @ 80), (N/A, 30), (N/A)
(57240 - 63720 @ 2160), (N/A, 40), (N/A)
And now let’s reverse the order, but first unload all modules again:
modprobe -rv l2tp_netlink
rmmod l2tp_netlink
rmmod l2tp_core
rmmod udp_tunnel
rmmod ip6_udp_tunnel
modprobe -rv cfg80211
rmmod cfg80211
So now, first load l2tp_netlink and then cfg80211:
modprobe -v l2tp_netlink
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/ipv4/udp_tunnel.ko
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/ipv6/ip6_udp_tunnel.ko
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/l2tp/l2tp_core.ko
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/l2tp/l2tp_netlink.ko
modprobe -v cfg80211
insmod /lib/modules/4.10.0-1.g81ace5a-default/kernel/net/wireless/cfg80211.ko
And finally, repeat the test:
COUNTRY=DE crda ; echo $?
nl80211 not found.
251
Now remove the l2tp_netlink module, load your respective wireless driver and you should be up and running again.
AK
P.S. Sorry, Freund aus dem Sauerland, da war ich ein klein wenig zu langsam.