CC'ing the list as well.
Hi Mohammad,You need to load the WireGuard kernel module on your host OS, not inside the containers. All containers "share" and run on the same kernel as the host OS does.Best regards,ZsoltOn Sat, 21 Jul 2018, 23:34 Mohammad Amir Heshmatkhah, <maheshmatkhah.soft@gmail.com> wrote:_______________________________________________Hi,I want to run WireGuard on a docker container as server,I try difrent base Images but I get this error message every time:[#] ip link add wg0 type wireguardRTNETLINK answers: Operation not supportedUnable to access interface: Protocol not supported[#] ip link delete dev wg0Cannot find device "wg0"Here is 3 Dokerfiles I tried:FROM alpine:3.7RUN apk upgrade --update \&& apk add --no-cache bash wireguard-toolsENTRYPOINT [ "wg-quick", "up", "wg0" ]————————————-FROM ubuntu:16.04RUN apt-get update && apt-get install -y software-properties-common apt-utils \&& add-apt-repository ppa:wireguard/wireguard \&& apt-get update \&& apt-get install -y iproute linux-headers-$(uname -r) wireguard-dkms wireguard-tools wireguardENTRYPOINT [ "wg-quick", "up", "wg0" ]————————————-FROM debian:9RUN echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list \&& printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable \&& apt-get update && apt-get install -y wireguardENTRYPOINT [ "wg-quick", "up", "wg0" ]————————————-I run this containers with:sudo docker run -it -v $(pwd)/config:/etc/wireguard/ -v /dev:/dev -v /lib/modules:/lib/modules --cap-add=ALL --privileged <image name here>where wg0.conf is located in " $(pwd)/config/wg0.conf" on host machine————————————-and here is my wg0.conf file:[Interface]Address = 172.26.10.1/24SaveConfig = truePrivateKey = <server private key here>ListenPort = 40540[Peer]PublicKey = <client public key here>AllowedIPs = 172.26.10.2/32————————————-So, How can I fix this "Unable to access interface: Protocol not supported" error?
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard