Ubuntu: Connecting to VPN server closes SSH tunnel



Question:

Once I start to connect the VPN, I immediately lose the connection to my dedi-server. My aim is to still be able to ssh to my dedi-server, even if I connect to the external VPN server with my dedi-server.

Home-PC <---(SSH)---> dedi-server (openvpn client) <---(VPN)---> Internet etc.

I could do that and it would work for my PC:

route add -host 4.5.6.7 gw 7.8.9.1      #public IP Home-PC: 4.5.6.7      #default gateway dedi-server: 7.8.9.1  

But I need something that works for every SSH/SFTP connection to my dedi-server, say to port 5577.

Is there a simple possibility?

Infos:

root@1404-box ~ # netstat -rn  Kernel IP routing table  Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface  0.0.0.0         7.8.9.1         0.0.0.0         UG        0 0          0 eth0  7.8.9.0         7.8.9.1         255.255.255.192 UG        0 0          0 eth0  7.8.9.0         0.0.0.0         255.255.255.192 U         0 0          0 eth0        root@1404-box ~ # ifconfig  eth0      Link encap:Ethernet  HWaddr xxxxxxxxxxxxxxxxxxxxx            inet addr:7.8.9.7  Bcast:7.8.9.63  Mask:255.255.255.192            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1            RX packets:1154 errors:0 dropped:0 overruns:0 frame:0            TX packets:1221 errors:0 dropped:0 overruns:0 carrier:0            collisions:0 txqueuelen:1000            RX bytes:115376 (115.3 KB)  TX bytes:170034 (170.0 KB)            Interrupt:16 Memory:f9fe0000-fa000000    lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0            UP LOOPBACK RUNNING  MTU:65536  Metric:1            RX packets:4 errors:0 dropped:0 overruns:0 frame:0            TX packets:4 errors:0 dropped:0 overruns:0 carrier:0            collisions:0 txqueuelen:0            RX bytes:368 (368.0 B)  TX bytes:368 (368.0 B)  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »