Skip to content

Instantly share code, notes, and snippets.

@MonsieurV
Created September 8, 2019 15:37
Show Gist options
  • Save MonsieurV/f4cf28384e20e2606c613c1993f7b522 to your computer and use it in GitHub Desktop.
Save MonsieurV/f4cf28384e20e2606c613c1993f7b522 to your computer and use it in GitHub Desktop.
How to include or exclude traffic from routing to an OpenVPN connection?
client
dev tun
proto udp
remote X.X.X.X 1194
# ----------------
# Routing configuration pulling
# ----------------
# To pull routing conf pushed by the OpenVPN server
pull
# To prevent the conf pushed by the server to be applied
# route-nopull
# ----------------
# Routing local conf
# ----------------
# redirect local network to NOT go via the VPN
# the net_gateway at the end is key
route 192.168.0.0 255.255.0.0 net_gateway
# For more details, see
# https://askubuntu.com/questions/612840/adding-route-on-client-using-openvpn
# https://serverfault.com/questions/631037/how-to-route-only-specific-openvpn-traffic-through-a-openvpn-
# ----------------
# User Pass Auth
# ----------------
# Auth by CLI / interractive
# auth-user-pass
# Auth credentials in a file (first line user; second line passowrd)
# auth-user-pass ./credentials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment