Wireguard module not loaded

Hi, everyone. I want to install Wireguard client to route all traffic through VPN. I've installed packages, set up connection through web ui, but nothing is happening. Wireguard status page is empty and network interface is not connected.

From what I understand, wireguard kernel module is not being loaded:

root@OpenWrt:~# wg show
root@OpenWrt:~# lsmod | grep wireguard
root@OpenWrt:~# modprobe wireguard
1 module could not be probed
- wireguard

Log shows some errors:

daemon.err modprobe: 1 module could not be probed
daemon.err modprobe: - wireguard
daemon.notice netifd: wg0 (32404): RTNETLINK answers: Not supported
kern.warn kernel: [41283.517132] wireguard: Unknown symbol udp_sock_create4 (err -2)
kern.warn kernel: [41283.523143] wireguard: Unknown symbol dst_cache_set_ip4 (err 0)
kern.warn kernel: [41283.529069] wireguard: Unknown symbol udp_tunnel6_xmit_skb (err -2)
kern.warn kernel: [41283.535490] wireguard: Unknown symbol dst_cache_destroy (err 0)
kern.warn kernel: [41283.541472] wireguard: Unknown symbol dst_cache_init (err 0)
kern.warn kernel: [41283.547331] wireguard: Unknown symbol udp_tunnel_sock_release (err -2)
kern.warn kernel: [41283.554038] wireguard: Unknown symbol setup_udp_tunnel_sock (err -2)
kern.warn kernel: [41283.560400] wireguard: Unknown symbol udp_sock_create6 (err -2)
kern.warn kernel: [41283.566496] wireguard: Unknown symbol dst_cache_get_ip6 (err 0)
kern.warn kernel: [41283.572503] wireguard: Unknown symbol dst_cache_get_ip4 (err 0)
kern.warn kernel: [41283.578452] wireguard: Unknown symbol dst_cache_set_ip6 (err 0)
kern.warn kernel: [41283.584480] wireguard: Unknown symbol udp_tunnel_xmit_skb (err -2)

Not sure where to go from here. Please help!

I use OpenWrt 19.07.4 on Xiaomi Router 4. I'm new to OpenWrt so if there is some more info I can provide please tell.

System version info
root@OpenWrt:~# uname -r
4.14.195
root@OpenWrt:~# opkg list-installed | grep wireguard
kmod-wireguard - 4.14.195+1.0.20200611-1
luci-app-wireguard - git-20.341.57626-51f55b5-1
luci-i18n-wireguard-en - git-20.341.57626-51f55b5-1
luci-proto-wireguard - git-20.341.57626-51f55b5-1
wireguard - 1.0.20200611-1
wireguard-tools - 1.0.20191226-1

Have you installed all the dependencies for kmod-wireguard ?

Yes. I've tried reinstalling with opkg and manually checked that dependencies kmod-udptunnel6, kmod-udptunnel4 are loaded.

No change. logread shows more of the same. It tries loading wireguard every 5 seconds or so and fails.

1 Like
modprobe udp_tunnel
modprobe ip6_udp_tunnel
modprobe wireguard

What is the output?

root@OpenWrt:~# modprobe udp_tunnel
udp_tunnel is already loaded
root@OpenWrt:~# modprobe ip6_udp_tunnel
ip6_udp_tunnel is already loaded
root@OpenWrt:~# modprobe wireguard
1 module could not be probed
- wireguard
1 Like

Might actually be something you should look into ...

1 Like
opkg update
opkg --force-reinstall install \
    kmod-udptunnel4 kmod-udptunnel6 kmod-wireguard libmnl0 ip \
    wireguard wireguard-tools luci-proto-wireguard luci-app-wireguard

Thank you. I'll try building the image myself and see if it works.

Fixes for module not loading on Ubuntu were a) upgrading kernel, or b) installing linux-headers-$(uname -r). But looks like this package does not exist for OpenWrt.

Thanks. I tried it and it didn't work. I even re-flashed sysupgrade image. I'll build the system image myself next.

1 Like

Yeah, Linux-headers is usually for compiling from source, which wouldn't be anything you'd do on the router.

1 Like

Update: I built an image with wireguard enabled in menuconfig. This worked perfectly, and now I have the setup I want.

For the record, I don't know what caused the original problem. Wireguard kernel module didn't see symbols declared in udp_tunnel and ip6_udp_tunnel. I found this email from original creator of wireguard module, who had the same issue in 2016.

Thank you for your help, @frollic and @vgaetera

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.