OpenVPN
Getting started
Section titled “Getting started”Connect to any OpenVPN protocol-compatible server or service.
References
Section titled “References”-
Select version
Section titled “Select version”openvpn 2.x
Section titled “openvpn 2.x”Install
Section titled “Install”Terminal window sudo apt install openvpn -yopenvpn3
Section titled “openvpn3”-
Add keyring
Section titled “Add keyring”Terminal window sudo mkdir -p /etc/apt/keyrings && curl -fsSL https://packages.openvpn.net/packages-repo.gpg | sudo tee /etc/apt/keyrings/openvpn.asc -
Assign
Section titled “Assign DISTO variable”DISTOvariableTerminal window DISTRO=$(lsb_release -c -s) -
Add apt source
Section titled “Add apt source”Terminal window echo "deb [signed-by=/etc/apt/keyrings/openvpn.asc] https://packages.openvpn.net/openvpn3/debian $DISTRO main" | sudo tee /etc/apt/sources.list.d/openvpn-packages.list -
Update apt
Section titled “Update apt”Terminal window sudo apt update -
Install
Section titled “Install”Terminal window sudo apt install openvpn3 -y
-
-
Make directory
Section titled “Make directory”Terminal window mkdir -p /etc/openvpn/profile && cd /etc/openvpn/profile -
Modify .ovpn files
Section titled “Modify .ovpn files”Terminal window nano server1-tcp80.ovpnserver1-tcp80.ovpn # Comment out the line below# setenv opt block-outside-dns# Add after `route 0.0.0.0 0.0.0.0`setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binscript-security 2up /etc/openvpn/update-resolv-confdown /etc/openvpn/update-resolv-confdown-pre -
Modify update-resolv-conf
Section titled “Modify update-resolv-conf”Terminal window nano /etc/openvpn/update-resolv-confupdate-resolv-conf # Add after examples# Add as many as you like, replace ip addressforeign_option_1='dhcp-option DNS 208.67.222.222'foreign_option_2='dhcp-option DNS 208.67.222.220'foreign_option_3='dhcp-option DNS 146.112.128.66' -
Create auth.txt
Section titled “Create auth.txt”Terminal window nano auth.txtauth.txt # Edit username and passwordusernamepassword -
Connect
Section titled “Connect”Terminal window sudo openvpn --config /etc/openvpn/profile/server1-tcp80.ovpn -
Terminal window sudo killall openvpn