commit f1d2e242d816ade9419df8f90a1a024921937f12 Author: Gašper Dobrovoljc Date: Tue Jun 20 18:59:30 2023 +0200 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c5c9d00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM alpine:3.18 + +RUN apk add --no-cache --update-cache frr wireguard-tools tini + +RUN mkdir -p /var/run/frr +RUN chown -R frr:frr /etc/frr /var/run/frr + + +ENTRYPOINT ["/sbin/tini", "--"] + +COPY docker-entrypoint.sh /usr/local/bin/ + +CMD ["sh", "-c", "/usr/local/bin/docker-entrypoint.sh"] \ No newline at end of file diff --git a/config/frr/daemons b/config/frr/daemons new file mode 100644 index 0000000..37da5d8 --- /dev/null +++ b/config/frr/daemons @@ -0,0 +1 @@ +ospfd=yes \ No newline at end of file diff --git a/config/frr/ospfd.conf b/config/frr/ospfd.conf new file mode 100644 index 0000000..11aa342 --- /dev/null +++ b/config/frr/ospfd.conf @@ -0,0 +1,7 @@ +interface wg0 + ip ospf area 0.0.0.0 + ip ospf network point-to-point + +router ospf + redistribute connected + redistribute kernel \ No newline at end of file diff --git a/config/frr/staticd.conf b/config/frr/staticd.conf new file mode 100644 index 0000000..e69de29 diff --git a/config/frr/zebra.conf b/config/frr/zebra.conf new file mode 100644 index 0000000..7c30d06 --- /dev/null +++ b/config/frr/zebra.conf @@ -0,0 +1,2 @@ +interface wg0 + ip address 192.168.0.2/24 \ No newline at end of file diff --git a/config/wireguard/wg0.conf b/config/wireguard/wg0.conf new file mode 100644 index 0000000..19f0335 --- /dev/null +++ b/config/wireguard/wg0.conf @@ -0,0 +1,10 @@ +[Interface] +Address = 192.168.0.2/24 +PrivateKey = +ExnETUyonPZX/8/yvhiVAlhLVDPIt9LoFCx+OCbPmY= +ListenPort = 13231 +Table = off + +[Peer] +PublicKey = XnjYy1wiQrdEK6/uR45RTxmJ5/U7a8RCvlD/XfcmETU= +AllowedIPs = 0.0.0.0/0 +Endpoint = 10.40.0.114:13231 \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..8de1c35 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,17 @@ +version: "3.9" + +services: + backbone: + build: . + container_name: backbone + ports: + - 13231:13231/udp + cap_add: + - NET_ADMIN + - CAP_SYS_ADMIN + sysctls: + - net.ipv4.conf.all.src_valid_mark=1 + - net.ipv4.ip_forward=1 + volumes: + - ./config/frr:/etc/frr + - ./config/wireguard:/etc/wireguard diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..22d5b0c --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +wg-quick up wg0 + +/usr/lib/frr/watchfrr -F traditional zebra ospfd \ No newline at end of file