Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

ip route add PUBLICHOMEIP via PUBLICSERVERIP

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 65.92.234.xxx via 178.18.xx.xxx –  Arya Jun 25 '13 at 8:49

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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