Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Create/remove tun device dynamically #11

Open
jonjonw opened this issue Sep 29, 2018 · 0 comments
Open

Feature Request: Create/remove tun device dynamically #11

jonjonw opened this issue Sep 29, 2018 · 0 comments

Comments

@jonjonw
Copy link

jonjonw commented Sep 29, 2018

Instead of creating an entry in /etc/systemd/network, you could create the tun device in the unit file (and destroy it after as well). This would keep the list of links less cluttered when it's not running.

To do this, you can delete the systemd-network netdev file and add a file at /etc/systemd/system/openvpn-client@{configname}.service.d/tuntap.conf containing:

[Service]
ExecStartPre=+/usr/bin/ip tuntap del name tun-pia mode tun
ExecStartPre=+/usr/bin/ip tuntap add name tun-vpn mode tun user openvpn group openvpn
ExecStopPost=+/usr/bin/ip tuntap del name tun-vpn mode tun

Replacing tun-vpn and the user/group as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant