wireguard: use custom wg-quick

This removes things we do not need and expects the interface to
already be created.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2017-08-23 17:02:58 +01:00
parent ed8d367e2a
commit 8f3847e985
5 changed files with 24 additions and 14 deletions

View File

@@ -11,11 +11,11 @@ onboot:
image: linuxkit/dhcpcd:f3f5413abb78fae9020e35bd4788fa93df4530b7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
- name: wg0
image: linuxkit/ip:b084fd2ada446015e00e43a441bb0ae41ff8b227
image: linuxkit/ip:044287be54a62d1590dcd4d22543c1a1031479e6
net: new
binds:
- /etc/wireguard:/etc/wireguard
command: ["sh", "-c", "ip link set dev wg0 up; ip address add dev wg0 192.168.2.1/24; wg setconf wg0 /etc/wireguard/wg0.conf; wg show wg0"]
command: ["/usr/bin/lk-wg-config", "configure", "/etc/wireguard/wg0.conf"]
runtime:
interfaces:
- name: wg0
@@ -24,11 +24,11 @@ onboot:
bindNS:
net: /run/netns/wg0
- name: wg1
image: linuxkit/ip:b084fd2ada446015e00e43a441bb0ae41ff8b227
image: linuxkit/ip:044287be54a62d1590dcd4d22543c1a1031479e6
net: new
binds:
- /etc/wireguard:/etc/wireguard
command: ["sh", "-c", "ip link set dev wg1 up; ip address add dev wg1 192.168.2.2/24; wg setconf wg1 /etc/wireguard/wg1.conf; wg show wg1"]
command: ["/usr/bin/lk-wg-config", "configure", "/etc/wireguard/wg1.conf"]
runtime:
interfaces:
- name: wg1
@@ -66,7 +66,8 @@ services:
files:
- path: etc/wireguard/wg0.conf
contents: |
[Interface]
[Interface]
Address = 192.168.2.1/24
PrivateKey = KG7EKkHDkp7THfW5mOXcZzo3RbGAjq+ARMfJGFm5G1s=
ListenPort = 51820
[Peer]
@@ -76,6 +77,7 @@ files:
- path: etc/wireguard/wg1.conf
contents: |
[Interface]
Address = 192.168.2.2/24
PrivateKey = SCGCKDuTm4PMOw+LXdK/2s8mxnv145QHOohKRq3vc2A=
ListenPort = 51821
[Peer]