3

is it possible to configure Windows 7 to connect to a OpenVPN Server using a different network interface.

My setup: 1. LAN -> public ip 2. LAN -> public ip 3. Tun -> private VPN

now i want that lan1 is used for normal surfing and lan2 is used for the tunnel.

Is this possible to configure?

3

The VPN gateway is routed just like everything else. All you need is to add a route pointing to the VPN gateway, leading out the preferred NIC.

route add <VPN gateway IP> mask 255.255.255.255 <default gateway IP> metric 1 if <interface number>

The <default gateway IP> needs to be the local default gateway for the NIC in question, the <interface number> you can get with route print. You can omit the if <interface number> when the default gateway isn't reachable from the other NIC.

| improve this answer | |
  • thanks for your answer, but does not work. i use the vpn only for a samba share and want that the traffic is send via the second interface. is there a option to force openvpn using the second card? – F. Heckl Jul 13 '17 at 13:42
  • Please try a traceroute <VPN gateway IP> to verify the routing is working. If it doesn't please post route print output and your network/IP address details (they don't have to be real). – Zac67 Jul 13 '17 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.