On this machine, I have two wired NICs, connected to my LAN.
I use one of the interfaces for just the VPN client to use, all the other traffic should be going to the other NIC. I have "automatic metric" turned off and metric value set for both NICs so that the NIC1 is used by default.
I've got the OpenVPN client set up to use NIC2 by using local in the configuration. This is working fine.
What I want to do is continue to have internet traffic, by default, be routed to NIC1. I plan to run a small socks5 server locally on the machine and have it send its outgoing traffic to the interface of the tap adapter used by openvpn and have it serve on the NIC2 interface address.
The problem I'm having is that when the VPN is connected, it updates the routing table, and all internet traffic is going to the OpenVPN interface. I've adjusted the metric for the tap adapter, but this seems to have no effect, all WAN traffic goes through the VPN.
Here is the routing table with the VPN connected: (NIC1 is 192.168.1.3 and NIC2 is 192.168.1.6, and the tap adapter has been assigned 10.194.90.6 in this case)
Code: Select all
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.3 60
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.6 80
0.0.0.0 128.0.0.0 10.194.90.5 10.194.90.6 70
10.194.90.1 255.255.255.255 10.194.90.5 10.194.90.6 70
10.194.90.4 255.255.255.252 On-link 10.194.90.6 326
10.194.90.6 255.255.255.255 On-link 10.194.90.6 326
10.194.90.7 255.255.255.255 On-link 10.194.90.6 326
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
128.0.0.0 128.0.0.0 10.194.90.5 10.194.90.6 70
192.168.1.0 255.255.255.0 On-link 192.168.1.3 286
192.168.1.0 255.255.255.0 On-link 192.168.1.6 296
192.168.1.3 255.255.255.255 On-link 192.168.1.3 286
192.168.1.6 255.255.255.255 On-link 192.168.1.6 296
192.168.1.255 255.255.255.255 On-link 192.168.1.3 286
192.168.1.255 255.255.255.255 On-link 192.168.1.6 296
198.144.156.144 255.255.255.255 192.168.1.1 192.168.1.3 31
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.1.3 286
224.0.0.0 240.0.0.0 On-link 10.194.90.6 326
224.0.0.0 240.0.0.0 On-link 192.168.1.6 296
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.1.3 286
255.255.255.255 255.255.255.255 On-link 10.194.90.6 326
255.255.255.255 255.255.255.255 On-link 192.168.1.6 296
===========================================================================
Persistent Routes:
None
Code: Select all
client
dev tun
proto udp
local 192.168.1.6
resolv-retry infinite
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass c:/Users/xxxxx/AppData/Local/piapwd.txt
comp-lzo
verb 1
reneg-sec 0
script-security 2 system
route-up "c:/scripts/piastart.bat"
down "c:/scripts/piastop.bat"
explicit-exit-notify