Openvpn to Only Access Remote Server Resources

I have set up OpenVPN server on a CentOS 8 machine in the office, wanting to access the server from home. I have noticed though that all internet traffic is being routed through then VPN. Ideally from home my internet access would be direct, and only when office based resources are required, to use the VPN connection. I have been reading about split tunneling, but don't yet know whether it is a server or client side option, or how to do it at all. Is split tunneling what I am looking for?

How can my ultimate objective be achieved?

6

1 Answer

In the case I have presented, three things were required of the VPN server configuration.

1) Eliminate the gateway redirect

;push "redirect-gateway def1 bypass-dhcp"

2) Create a specific route to the office subnet

push "route x.x.x.x 255.255.255.0"

3) Disable the push of DNS servers, in this configuration Google's IPv4 addresses:

;push "dhcp-option DNS 8.8.8.8"
;push "dhcp-option DNS 8.8.4.4"

Credit to @Tom Yan in the comments in arriving at this solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest