Last active
August 5, 2022 17:24
-
-
Save gdamjan/6b988389afe36e4bb769 to your computer and use it in GitHub Desktop.
bridged openvpn with networkd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/openvpn/bridged.conf | |
comp-lzo | |
persist-key | |
persist-tun | |
dh /etc/openvpn/dh1024.pem | |
ca /etc/openvpn/ca.crt | |
cert /etc/openvpn/bridged.crt | |
key /etc/openvpn/bridged.key | |
dev vpntap0 | |
dev-type tap | |
mode server | |
tls-server | |
keepalive 10 120 | |
port 1194 | |
proto udp | |
status /run/openvpn/bridged-status.log | |
verb 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/[email protected] | |
[Unit] | |
Description=Home openvpn server | |
After=network.target | |
[Service] | |
Type=forking | |
ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i --writepid /run/openvpn/%i.pid | |
PIDFile=/run/openvpn/%i.pid | |
Restart=always | |
RuntimeDirectory=openvpn | |
ExecReload=/bin/kill -HUP $MAINPID | |
User=nobody | |
ProtectHome=true | |
ProtectSystem=full | |
PrivateTmp=true | |
NoNewPrivileges=true | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/network/vpntap0.netdev | |
[NetDev] | |
Name=vpntap0 | |
Kind=tap | |
[Tap] | |
#PacketInfo=true | |
User=nobody |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/network/vpntap0.network | |
[Match] | |
Name=vpntap0 | |
[Network] | |
Bridge=bridge0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment