Embora a situação descrita por você não seja possível (o aplicativo em execução não pode sobrescrever a tabela de roteamento do sistema), você pode ter várias opções:
- configurar um proxy na rede que você está acessando por VPN e fazer com que seus aplicativos usem esse proxy como padrão. Existem vários proxies que você pode escolher dependendo do protocolo que seu aplicativo está usando
- ssh para um host na rede em questão e explora o serviço ssh-s chamado como Dynamic Forwarding . Este é basicamente um proxy SOCKS feito de seu cliente ssh. Você pode então configurar seu aplicativo usando este proxy ou ajustá-lo com tsocks (Transparent Socks)
man ssh_config
DynamicForward
Specifies that a TCP port on the local machine be forwarded over the
secure channel, and the application protocol is then used to determine
where to connect to from the remote machine.
The argument must be [bind_address:]port. IPv6 addresses can be specified
by enclosing addresses in square brackets or by using an alternative syn‐
tax: [bind_address/]port. By default, the local port is bound in accor‐
dance with the GatewayPorts setting. However, an explicit bind_address
may be used to bind the connection to a specific address. The
bind_address of “localhost” indicates that the listening port be bound for
local use only, while an empty address or ‘*’ indicates that the port
should be available from all interfaces.
Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh(1) will
act as a SOCKS server. Multiple forwardings may be specified, and addi‐
tional forwardings can be given on the command line. Only the superuser
can forward privileged ports.