If the openvpn client specifies the domain name or IP to be accessed, use vpn

there is a problem. When using openvpn to connect to the company"s intranet, local traffic will go through this vpn globally, so that other traffic will slow down

.

so how can it be set locally to make openvpn local (specify the access domain name or IP)?

May.25,2022

openvpn can achieve the effect similar to whitelist and blacklist, and you can modify the routing configuration in the configuration file. Specifically, you can search openvpn whitelist and other related terms


you only need two steps

  1. restore the native default gateway
  2. add a new route: traffic from the network segment of the company's intranet goes through the VPN channel
< hr >

take the Linux client as an example

  1. add startup parameters to ignore the gateway address issued by the VPN server

    --pull-filter ignore redirect-gateway
  2. suppose the company's intranet 172.17.0.0 tun0 16, VPN virtual network card tun0, then add a route

    sudo route add 172.17.0.0/16 dev tun0
Menu