1

The problem lays on my side. The ip address im trying to resolve is 192.168.4.201 which routes through 192.168.1.1 (my local area network) instead of routing through VPN (10.10.X.X). How do i force 192.168.4.201 to always route through vpn 10.10.x.x ??

I have Ubuntu and I'm using StrongSwan 4.6.4.

mtak
  • 16,513
  • 2
  • 52
  • 64
user2207495
  • 111
  • 2

1 Answers1

1

You should add a route to your routing table.

sudo route add -net 192.168.4.0/24 gw 10.10.x.1 dev vtun0

(change the values where needed. The 10.10.x.1 should be the address of the gateway of the VPN and the device should be the virtual NIC created by the VPN software)

Possibly you can also have the VPN server do this for you. For example in OpenVPN you can add the following statement:

push "route 192.168.4.0 255.255.255.0"
mtak
  • 16,513
  • 2
  • 52
  • 64
  • The problem is vpn does not create virtual NIC. I only have eth0, should i route dev eth0? – user2207495 Aug 04 '14 at 13:56
  • As you can imagine it would be very helpful to include which VPN product you are using... – mtak Aug 04 '14 at 13:59
  • You mean client? Im using strongswan 4.6.4 – user2207495 Aug 04 '14 at 14:02
  • I am not familiar with that particular product, but you can take a look at this: https://wiki.strongswan.org/projects/strongswan/wiki/ForwardingAndSplitTunneling What you want to do is called split tunneling. – mtak Aug 04 '14 at 14:04