How to configure custom traffic routing on a client device using routing utilities to separate work and personal traffic through a VPN?
The standard behavior of most VPN clients is to redirect absolutely all device internet traffic through a remote gateway. However, in practice, there is often a need to route only specific domains or subnets through the VPN, leaving other connections to work via the local provider to maintain high access speeds to local resources.
To implement selective routing, the operating system's routing tables or advanced clients with support for domain name-based rules are used. In Linux systems, this is implemented using the ip route utility combined with packet marking via iptables or nftables, which allows intercepting requests to specific IP addresses.
Using such configurations requires regular updating of routing lists, as many modern web resources use dynamic IP address pools and distributed CDN content delivery networks.