Access to internet with a company's VPN connection

1

I have connected to a company's VPN connection, and this connection have not a internet connection.

I need to connect to internet. Can I define routes to connect the external traffic to the router home IP? It is possible?

I use GNU/Linux (Ubuntu).

I try to mark "Use this connection only for resources on its network" in VPN connection, but doesn't work the internal connections.

The Rangue IP in my local network: 192.168.1.2 (255.255.255.0) The Rangue of IP in my VPN connection (PPP): 192.168.2.58 (255.255.255.255)

Thanks you.

OUTPUT OF ROUTE COMMAND

Destino         Pasarela        Genmask         Indic Métric Ref    Uso Interfaz
default         *               0.0.0.0         U     0   0        0 ppp0
link-local      *               255.255.0.0     U     1000   0        0 eth0
192.168.1.0     *               255.255.255.0   U     1      0        0 eth0
192.168.2.1     *               255.255.255.255 UH    0      0        0 ppp0

user2024475

Posted 2013-08-06T07:07:26.630

Reputation: 13

1Hmm, don't you have to be connected to the internet in the first place to make use of VPN? Otherwise, you clearly must be at your workplace I guess? – matcheek – 2013-08-06T07:10:18.547

What show the output of "route"? You can set different routes – kockiren – 2013-08-06T07:10:55.783

What VPN software do you use? Does it create its own virtual network adapter? – Marcel Waldvogel – 2013-08-06T07:16:58.037

Yes I am connected to the internet with my home connection. The router IP (gateway) is 192.168.1.1 – user2024475 – 2013-08-06T07:17:13.397

I use Ubuntu interface (gnome) to config the VPN. No use a software. – user2024475 – 2013-08-06T07:22:18.697

In which case IP address visible online will be the one from your company's VPN gateway? Isn't that already what you want? – matcheek – 2013-08-06T07:22:20.367

In main post I paste the output of "route" command – user2024475 – 2013-08-06T07:31:04.197

you can set route add default gw 192.168.1.1 than show output of route command again – kockiren – 2013-08-06T07:41:19.593

This not work. I lost the local connection. – user2024475 – 2013-08-06T08:24:03.300

I used to have this problem in my previous job and my solution was to use a Virtual Machine with the guest running the VPN connection and that left the host free to access the internet. – psubsee2003 – 2013-08-06T08:41:00.820

Answers

1

If you connect to your VPN you can set on route to a special Host for example with this command:

route add -host 192.168.2.100 dev ppp0

With this command you can set the default Gateway to your local gateway:

route add default gw 192.168.1.1 dev eth0

If there is any other default gateway you can delete it first with:

route del default gw

kockiren

Posted 2013-08-06T07:07:26.630

Reputation: 432

which is the order in which the routes are execute in case of overlapping routes? – user2024475 – 2013-08-06T10:28:31.700

If you have overlapping routes you can set a route for a special network and the default gw match if no other route match. – kockiren – 2013-08-06T12:37:19.507