Split tunneling: Difference between revisions
From James's Wiki
No edit summary |
|||
Line 1: | Line 1: | ||
setup openvpn | |||
create systemd service file for openvpn | |||
sudo nano /etc/systemd/system/openvpn@openvpn.service | |||
[Unit] | |||
Description=OpenVPN connection to %i | |||
Documentation=man:openvpn(8) | |||
Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage | |||
Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO | |||
After=network.target | |||
[Service] | |||
RuntimeDirectory=openvpn | |||
PrivateTmp=true | |||
KillMode=mixed | |||
Type=forking | |||
ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn -- | |||
script-security 2 --config /etc/openvpn/%i.conf --writepid /run/openvpn/%i.pid | |||
PIDFile=/run/openvpn/%i.pid | |||
ExecReload=/bin/kill -HUP $MAINPID | |||
WorkingDirectory=/etc/openvpn | |||
Restart=on-failure | |||
RestartSec=3 | |||
ProtectSystem=yes | |||
LimitNPROC=10 | |||
DeviceAllow=/dev/null rw | |||
DeviceAllow=/dev/net/tun rw | |||
[Install] | |||
WantedBy=multi-user.target | |||
Revision as of 21:35, 3 March 2022
setup openvpn
create systemd service file for openvpn
sudo nano /etc/systemd/system/openvpn@openvpn.service
[Unit] Description=OpenVPN connection to %i Documentation=man:openvpn(8) Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO After=network.target [Service] RuntimeDirectory=openvpn PrivateTmp=true KillMode=mixed Type=forking ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn -- script-security 2 --config /etc/openvpn/%i.conf --writepid /run/openvpn/%i.pid PIDFile=/run/openvpn/%i.pid ExecReload=/bin/kill -HUP $MAINPID WorkingDirectory=/etc/openvpn Restart=on-failure RestartSec=3 ProtectSystem=yes LimitNPROC=10 DeviceAllow=/dev/null rw DeviceAllow=/dev/net/tun rw [Install] WantedBy=multi-user.target
Sources
https://www.htpcguides.com/compile-latest-openvpn-from-source-on-debian-8/
https://www.htpcguides.com/force-torrent-traffic-vpn-split-tunnel-debian-8-ubuntu-16-04/