Wireguard initial setup

This commit is contained in:
Maciej Lebiest 2023-08-01 16:28:44 +02:00
parent 15383a8418
commit d5b35cdbef
3 changed files with 38 additions and 0 deletions

View file

@ -116,3 +116,17 @@ systemctl enable --now tornode.service;
# view nyx dashboard
podman exec -it tornode nyx
```
## Wireguard
Simple container that will setup wireguard interface according to
`/data/wg0.conf` and then replace process with pid 1 to `sleep infinity`.
MASQUERADE required for accessing external networks is done by nftables, so
it should work with nftables kernel modules, iptables-only modules can
be missing.
Example run (requires root and privileged for nftables setup)
```bash
podman run --privileged --name wireguard -d -v './:/data:ro' wireguard:latest
```

21
wireguard/Dockerfile Normal file
View file

@ -0,0 +1,21 @@
FROM registry.fedoraproject.org/fedora:38
ENV PKGS="\
wireguard-tools \
nftables \
bash-completion \
procps \
iproute"
COPY entrypoint.sh /usr/bin/
# install system dependencies
RUN dnf install -y \
${PKGS} \
&& dnf clean all &&\
chmod +x /usr/bin/entrypoint.sh
STOPSIGNAL SIGALRM
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]

3
wireguard/entrypoint.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
wg-quick up /data/wg0.conf && exec sleep infinity