Openvpn – Restrict VPN client traffic to certain domains/IP

domainipopenvpnroutingvpn

Is there any way to restrict a VPN client to only route certain traffic via the VPN and the rest via their local gateway?

For example: traffic to a certain IP or domain gets routed across the VPN and all other requests do not.

Let me know if you need more details.

Thank you.

Best Answer

I see this question tagged as openvpn, so I'Lll give an openvpn answer.

In openvpn you can make server "push" certain routes to the clients

openvpn server.conf

push "route 192.168.2.0 255.255.255.0"
push "route 1.2.3.0 255.255.255.0"

The client must have 'pull' in its config file.

see man openvpn(8) under --pull and --push

Related Topic