Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Preface: I know there are similar question here and there however I'm a kind of newbie on Net stuff so I need an answer on this specific scenario, hoping that can help others too as it is a common problem

Let say I cannot do anything on the local switch to change the local ip range, I don't want to use any complicate trick as use VMachine to hide the local ip range but I want to use net tools to solve the issue.


my local net assign me an IP of this class (ex. and my VPN (VPNC) assign me IP of same class (ex.

Obviously I need VPN to access local address (ex. but when I open any address of the class 192.168.1.xx the route point to my local net and not to the VPN ones.

I'm on linux and i'd like gui solution (network manager) in case it is not possible let play with route command.

here what network manager offer me: enter image description here

Here my actual route once connected to the VPN:

Here some route information (route -n)

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         U     0      0        0 ppp0     U     1000   0        0 wlan0
xxx.YY.ZZ.106 UGH   0      0        0 wlan0
xxx.YY.ZZ.106 UGH   0      0        0 wlan0   U     9      0        0 wlan0 UH    0      0        0 ppp0

Here my ifconfig :

ppp0      Link encap:Point-to-Point Protocol  
      inet addr:  P-t-P:  Mask:
      RX packets:3415 errors:0 dropped:0 overruns:0 frame:0
      TX packets:2525 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:3 
      RX bytes:3682328 (3.6 MB)  TX bytes:402315 (402.3 KB)

wlan0     Link encap:Ethernet  HWaddr 4c:eb:42:06:a3:a6  
      inet addr:  Bcast:  Mask:
      inet6 addr: fe80::4eeb:42ff:fe06:a3a6/64 Scope:Link
      RX packets:72598 errors:0 dropped:0 overruns:0 frame:0
      TX packets:42300 errors:0 dropped:0 overruns:0 carrier:0                                                  
      collisions:0 txqueuelen:1000                                                                              
      RX bytes:76000532 (76.0 MB)  TX bytes:13919400 (13.9 MB)

The Question So basically I would like to add a rule to force this particular address ( on the VPN and not on my local net

Solution - Thanks to Paul

This command will route the host out of the VPN:

ip route add dev ppp0

This is for the command line, but you can add it above in the dialog box of the first image.


Se below answer for detail

share|improve this question
I know my english is far to be perfect :) and my networking terminology could not be accurate so if you find that the question is not clear or contains semantic error please fell free to enhance it – Francesco Jun 26 '13 at 3:02
Hello - can you edit your scenario. You refer to .116 and .247 and explain what they are, but then you bring in .100 without explaining it. Is this local or over the VPN? – Paul Jun 26 '13 at 3:04
Oh, I think I understand. I get that you can't change the local IP address range, but if the VPN is yours, can you change the IP addresses it gives out? – Paul Jun 26 '13 at 3:22
I cannot change VPN ip address too, you know server admin ... they complain they have to change a too many static ip on office side – Francesco Jun 26 '13 at 4:05
I have added some more info to undestand the scenario – Francesco Jun 26 '13 at 4:10
up vote 1 down vote accepted

I think you are going to have a problem in any case. This command will route the host out of the VPN:

ip route add dev ppp0

This is for the command line, but you can add it above in the dialog box of the first image.

Gateway:  (the ubuntu vpnc client does not let you specify a device)

Your problem is that will need to route back to you. So it will see packets coming from and think that this address is on its local network. So it will then broadcast on the local network asking who has the IP address, and it will go unanswered.

So you need the same route back. But this doesn't help you, because you are over a VPN and your IP address is changing. This route added to would tell it that .247 is behind the VPN gateway:

ip route add via xxx.YY.ZZ.106 [ip address of vpn server]

This will only last as long as you remain on .247 As soon as you disconnect and reconnect, you'll have another IP address, and need to change the route.

The golden rule here is that you should avoid using the same address range for both ends of the VPN.

share|improve this answer
The second route must be added to - the box you are trying to get to. I have updated the answer. – Paul Jun 26 '13 at 5:50
adding this ip route add dev ppp0 was enough to solve the issue thanks very much – Francesco Jun 26 '13 at 6:41
@Francesco If you get the same IP each time, this should be ok. – Paul Jun 26 '13 at 7:03
thanks u again, this works like charm :) – Francesco Jun 26 '13 at 7:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .