linuxserver / docker-wireguard

GNU General Public License v3.0
2.94k stars 366 forks source link

RTNETLINK answers: Operation not supported && Cannot find device "wg0" #36

Closed simondrake closed 4 years ago

simondrake commented 4 years ago

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

Docker container loads correctly

Current Behavior

Docker container errors during start

Steps to Reproduce

  1. Create docker-compose.yaml with the following contents
---
version: "2.1"
services:
  wireguard:
    image: linuxserver/wireguard
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
   #  - SERVERURL=[redacted] #optional
      - SERVERPORT=51820 #optional
      - PEERS=1 #optional
   #  - PEERDNS=auto #optional
   #  - INTERNAL_SUBNET=10.13.13.0 #optional
    volumes:
      - /home/ubuntu/wireguard/config:/config
      - /lib/modules:/lib/modules
    ports:
      - 51820:51820/udp
      - 51820:51820/tcp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
      - net.ipv6.conf.all.disable_ipv6=0
    restart: unless-stopped
  1. Run docker-compose up -d
  2. Run docker logs -f wireguard
  3. Observe the following errors
wireguard is already the newest version (1.0.20200513-1~18.04).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Server mode is selected
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    12  100    12    0     0     85      0 --:--:-- --:--:-- --:--:--    85
SERVERURL var is either not set or is set to "auto", setting external IP to auto detected value of [redacted]
External server port is set to 51820. Make sure that port is properly forwarded to port 51820 inside this container
Internal subnet is set to 10.13.13.0
PEERDNS var is either not set or is set to "auto", setting peer DNS to 10.13.13.1 to use wireguard docker host's DNS.
Server mode is selected
No changes to parameters. Existing configs are used.
[cont-init.d] 30-config: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
.:53
CoreDNS-1.6.9
linux/amd64, go1.14.1, 1766568
[#] ip link add wg0 type wireguard
RTNETLINK answers: Operation not supported
Unable to access interface: Protocol not supported
[#] ip link delete dev wg0
Cannot find device "wg0"

Environment

OS: Ubuntu server 18.04 CPU architecture: x86_64 How docker service was installed:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04

Command used to create docker container (run/create/compose/screenshot)

As above

Docker logs

As above.

simondrake commented 4 years ago

This was fixed, with help from @aptalca and @drizuid on discord, by following these steps:

alexanderek commented 4 years ago

Same issue on Debian 10

simondrake commented 4 years ago

@alexanderek - did you try the steps I outlined above?

alexanderek commented 4 years ago

@alexanderek - did you try the steps I outlined above?

Debian doesn't have hwe kernel.

simondrake commented 4 years ago

Ah ok. I'd raise an issue of your own then, as my specific issue is now resolved.