Skip to content

Instantly share code, notes, and snippets.

@liviaerxin
Last active March 8, 2023 06:50
Show Gist options
  • Save liviaerxin/524a4feac95ae317b3143b0c4b99d4b0 to your computer and use it in GitHub Desktop.
Save liviaerxin/524a4feac95ae317b3143b0c4b99d4b0 to your computer and use it in GitHub Desktop.
OpenVPN Configuration #tools

OpenVPN Configuration

Client

Configure client your_client.ovpn file,

# redirect all default traffic via the VPN
redirect-gateway def1
# redirect another network to NOT go via the VPN
route 10.0.0.0 255.255.255.0 net_gateway
route 192.168.0.0 255.255.255.0 net_gateway
# redirect the Intranet network 192.168.254/24 via the VPN
route 192.168.254.0 255.255.255.0
# redirect a host using a domainname to NOT go via the VPN
#route www.google.ca 255.255.255.255 net_gateway

Start OpenVPN client as service on Ubuntu,

# move `your_client.ovpn` to `/etc/openvpn/` and rename it to end in `your_client.conf`
sudo mv ~/Downloads/your_client.ovpn /etc/openvpn/your_client.conf

# reload service
sudo systemctl restart openvpn

# disable auto start
sudo systemctl disable openvpn

# enable auto start
sudo systemctl enable openvpn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment