OpenVPN: Difference between revisions
imported>Gnidorah mNo edit summary |
imported>Samueldr m fixes heading levels |
||
Line 1: | Line 1: | ||
=VPN Client= | == VPN Client== | ||
OpenVPN can be configured for automatic startup by enabling it in <tt>/etc/nixos/configuration.nix</tt>: | OpenVPN can be configured for automatic startup by enabling it in <tt>/etc/nixos/configuration.nix</tt>: | ||
Line 18: | Line 18: | ||
Ensure you use absolute paths for any files such as certificates and keys referenced from the configuration files. | Ensure you use absolute paths for any files such as certificates and keys referenced from the configuration files. | ||
==Mounting filesystems via a VPN== | === Mounting filesystems via a VPN === | ||
If you mount filesystems through the VPN, the filesystem will not be unmounted properly because the VPN connection will be shut down prior to unmounting the filesystem. However, newer systemd versions allow you to set mount options to unmount the mount before closing the VPN connection via the mount option <tt>x-systemd.requires=openvpn-<em>vpnname</em>.service</tt>. | If you mount filesystems through the VPN, the filesystem will not be unmounted properly because the VPN connection will be shut down prior to unmounting the filesystem. However, newer systemd versions allow you to set mount options to unmount the mount before closing the VPN connection via the mount option <tt>x-systemd.requires=openvpn-<em>vpnname</em>.service</tt>. | ||
Line 44: | Line 44: | ||
If you want to run OpenVPN clients in NixOS declarative containers, you will need to set the {{nixos:option|enableTun}} container option. | If you want to run OpenVPN clients in NixOS declarative containers, you will need to set the {{nixos:option|enableTun}} container option. | ||
=VPN Server= | == VPN Server == | ||
==Simple one-client VPN gateway server== | === Simple one-client VPN gateway server === | ||
The following is an example of a VPN server configuration which supports a single known client. | The following is an example of a VPN server configuration which supports a single known client. | ||