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

I want to use a vpn connection on my Debian server but I get disconnected from ssh if I connect to the vpn. I thought by using the "ip route add" I can prevent getting disconnected from my server and it will continue to use the main connection for communication between my computer and the server, and the vpn for communication with other ips.

This is the command I use


But I get disconnected after the "ip route add" command too. Am I making a mistake anywhere?

share|improve this question
Can you provide the value of PUBLICHOMEIP and PUBLICSERVERIP or are they too sensitive? Also, the common way to had a router through a router is ip route add <subnet> via <router> dev <dev>. – pilona Jun 24 '13 at 18:11
I don't want to provide the full ip but it looks like this: x represents a single digit. ip route add via – Arya Jun 25 '13 at 8:49
up vote 0 down vote accepted

I found out how to fix the problem. The public server IP Address should not be entered but the server's gateway IP Address should be entered. You can find the server's gateway IP Address by using this command

route -n # if using the old, deprecated net-tools
ip route # or just `ip r`, if using iproute2

Here is a link for finding server's gateway IP address.

share|improve this answer
"server's gateway" rather than the "server's IP" - of course. The router must always be directly connected. You then had a more specific route than your default one that just blackholed packets. – pilona Jun 25 '13 at 20:22

You must log in to answer this question.

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