X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=machine_specific%2Fx2%2Ffilesystem%2Fetc%2Fsystemd%2Fsystem%2Fopenvpn-client-tr%40.service;fp=machine_specific%2Fx2%2Ffilesystem%2Fetc%2Fsystemd%2Fsystem%2Fopenvpn-client-tr%40.service;h=d16312d4afe020778a17c3e0fd4905fe66b3af02;hb=8d29de95be2b44cac6e2cc3d0643f542be05e4bd;hp=0000000000000000000000000000000000000000;hpb=b757c84a4fc56f58b4985681b76df655d8db007a;p=distro-setup diff --git a/machine_specific/x2/filesystem/etc/systemd/system/openvpn-client-tr@.service b/machine_specific/x2/filesystem/etc/systemd/system/openvpn-client-tr@.service new file mode 100644 index 0000000..d16312d --- /dev/null +++ b/machine_specific/x2/filesystem/etc/systemd/system/openvpn-client-tr@.service @@ -0,0 +1,36 @@ +[Unit] +Description=OpenVPN tunnel for %I +After=syslog.target network-online.target +Wants=network-online.target +Documentation=man:openvpn(8) +Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage +Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO +Requires=iptables.service + +[Service] +Type=notify +RuntimeDirectory=openvpn-client +RuntimeDirectoryMode=0710 +WorkingDirectory=/etc/openvpn/client +ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client/%i.conf +# todo, try reenabling this from the default openvpn, +# it was disabled so we could do bind mounts as a command, +# but now systemd handles it +#CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE +LimitNPROC=10 +# DeviceAllow=/dev/null rw +# DeviceAllow=/dev/net/tun rw + +# we use .1 to make this be on a different network than kd, so that we can +# talk to transmission on kd from remote host, and still use this +# vpn. +ExecStartPre=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns -n 10.174.13 start %i +ExecStartPre=/sbin/iptables-restore /a/bin/distro-setup/transmission-firewall/netns.rules +# allow wireguard network to connect +ExecStartPre=/usr/sbin/ip r add 10.8.0.0/24 via 10.174.13.1 dev veth1-client +ExecStopPost=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns stop %i +PrivateNetwork=true +BindReadOnlyPaths=/etc/tr-resolv:/run/systemd/resolve:norbind /etc/basic-nsswitch:/etc/resolved-nsswitch:norbind + +[Install] +WantedBy=multi-user.target