Retrict Docker Container To VPN

Jason A. Donenfeld Jason at zx2c4.com
Fri Feb 16 06:31:31 CET 2018


Hi Benni,

You're probably looking for this document:
https://www.wireguard.com/netns/

Basically you do this:

# ip link add wg0 type wireguard
# ip link set wg0 netns PID

Where "PID" is the PID of any process running in that Docker
container. After that, you'll be able to see wg0 inside the Docker
container, but not in the host. The only traffic that will leave the
Docker container will then be encrypted packets sent to peer
endpoints.

Jason


More information about the WireGuard mailing list