Most likely what happens is that establishing the VPN alters your routing table, so that now a reply to your remote position goes thru the VPN server. But since your remote position has been trying to contact your home, not your VPN server, it will discard the replies going thru the VPN server.
You may solve this problem by establishing, simultaneously to the VPN, a route to your remote station which does not use the VPN server. For instance, suppose your remote station has IP address 1.1.1.1, your normal home gateway/router is 192.168.0.1, while your VPN re-routes everything thru a VPN server at 2.2.2.2. Then what you need is that the VPN sets the following new route:
ip route add 1.1.1.1/32 via 192.168.0.1 dev eth0
The problem with this is that you should do this before setting up the VPN. Most VPNs that I know leave these extremely specific routes in place, so you may try the following order of operations:
Give the command above;
start your VPN;
keep your fingers crossed.
If this does not work (because the VPN rewrites your routing table completely), you should try, as sudo:
cmd_VPN; sleep 10; ip route add 1.1.1.1/32 via 192.168.0.1 dev eth0
where cmd_VPN
is whichever command you use to setup your VPN connection. The advantage of this is that the new route which you need is established after the VPN comes up. The sleep 10
is necessary to allow the VPN to change the routing table. For 10 seconds, you will be cutoff, but openssh is perfectly capable of resisting this.
You cannot test this from within your LAN: the normal route for the local lan is always left in place by all VPNs, so the above trick will work no matter what.
1When you use a VPN like PIA, it will disconnect your current network in order to clear the DNS cache. I don't think there is a solution for this... – cricket_007 – 2015-11-04T18:21:27.080
As everyone has stated, learn routing. What nobody else has stated, there are methods to send particular traffic to the VPN and other traffic through the original route. Also note that making your XRDP connection after your VPN connection is established would be more secure and just dandy. – Tmanok – 2018-03-20T23:00:59.350