<div dir="ltr"><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Hi,</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I want to run WireGuard on a docker container as server,</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I try difrent base Images but  I get this error message every time:</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">[#] ip link add wg0 type wireguard</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">RTNETLINK answers: Operation not supported</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Unable to access interface: Protocol not supported</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">[#] ip link delete dev wg0</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Cannot find device "wg0"</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Here is 3 Dokerfiles I tried:</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">FROM alpine:3.7</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">RUN apk upgrade --update \</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">&& echo<span> </span><a href="http://dl-cdn.alpinelinux.org/alpine/edge/testing" target="_blank" style="color:rgb(17,85,204)">http://dl-cdn.alpinelinux.org/alpine/edge/testing</a><span> </span>>> /etc/apk/repositories \</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">&& apk add --no-cache bash wireguard-tools</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">ENTRYPOINT [ "wg-quick", "up", "wg0" ]</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">————————————-</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">FROM ubuntu:16.04</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">RUN apt-get update && apt-get install -y software-properties-common apt-utils \ </div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">&& add-apt-repository ppa:wireguard/wireguard \</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">&& apt-get update \</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">&& apt-get install -y iproute linux-headers-$(uname -r) wireguard-dkms wireguard-tools wireguard</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">ENTRYPOINT [ "wg-quick", "up", "wg0" ]</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">————————————-</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">FROM debian:9</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">RUN echo "deb<span> </span><a href="http://deb.debian.org/debian/" target="_blank" style="color:rgb(17,85,204)">http://deb.debian.org/debian/</a><span> </span>unstable main" > /etc/apt/sources.list.d/unstable.list \</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">&& printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable \</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">&& apt-get update && apt-get install -y wireguard</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">ENTRYPOINT [ "wg-quick", "up", "wg0" ]</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">————————————-</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I run this containers with:</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">sudo docker run -it -v $(pwd)/config:/etc/wireguard/ -v  /dev:/dev  -v  /lib/modules:/lib/modules  --cap-add=ALL --privileged <image name here></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">where wg0.conf is located in " $(pwd)/config/<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">wg0.conf</span>" on host machine</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">————————————-</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">and here is my wg0.conf file:</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">[Interface]</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Address =<span> </span><a href="http://172.26.10.1/24" target="_blank" style="color:rgb(17,85,204)">172.26.10.1/24</a></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">SaveConfig = true</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">PrivateKey = <server private key here></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">ListenPort = 40540</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">[Peer]</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">PublicKey = <client public key here></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">AllowedIPs =<span> </span><a href="http://172.26.10.2/32" target="_blank" style="color:rgb(17,85,204)">172.26.10.2/32</a></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">————————————-</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">So, How can I fix this "<b>Unable to access interface: Protocol not supported</b>" error?</div><br></div>