Skip to content

Instantly share code, notes, and snippets.

@brian9206
Last active April 25, 2020 05:36
Show Gist options
  • Save brian9206/e0aaa483a80758be96a9e10a08bb41e8 to your computer and use it in GitHub Desktop.
Save brian9206/e0aaa483a80758be96a9e10a08bb41e8 to your computer and use it in GitHub Desktop.
/usr/lib/systemd/system/[email protected]
[Unit]
Description=OpenVPN dhclient for tunnels with External DHCPD (%I)
After=syslog.target network-online.target [email protected]
[email protected]
Wants=network-online.target
[Service]
Type=forking
PrivateTmp=true
WorkingDirectory=/etc/openvpn/client
ExecStartPre=/bin/sleep 2
ExecStart=/sbin/dhclient %i
CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE CAP_SYS_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=10
DeviceAllow=/dev/null rw
DeviceAllow=/dev/net/tun rw
ProtectSystem=true
ProtectHome=true
KillMode=process
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment