You are not logged in.

#1 2020-01-23 10:57:02

drossbox
Member
Registered: 2019-12-04
Posts: 22

Bypassing VPN using a routing table entry.

Hi all, I've had a google and mess about but can't find a definitive answer and don't want to mess anything up by experimenting further. When my VPN is up the output of 'ip route' shows:

default via 192.168.2.1 dev wlp0s20f3 proto dhcp metric 20600 
128.0.0.0/1 dev tun0 scope link 
185.65.135.223 via 192.168.2.1 dev wlp0s20f3 
192.168.2.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.2.3 metric 600 

The issue is that when my VPN is up, I can't SSH from 192.168.2.0/24 to 192.168.3.0/24. What format would a correct routing table command take to implement this?

Offline

#2 2020-01-23 11:37:43

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Bypassing VPN using a routing table entry.

Assuming the router at 192.168.2.1 is connected with the 192.168.3.0/24 subnet ,

$ ip route add 192.169.3.0/24 via 192.168.2.1

should work.

Keep in mind that firewall rules could block access even with a working route, verify connectability with ping .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2020-01-23 12:32:04

drossbox
Member
Registered: 2019-12-04
Posts: 22

Re: Bypassing VPN using a routing table entry.

Lone_Wolf wrote:

Assuming the router at 192.168.2.1 is connected with the 192.168.3.0/24 subnet ,

$ ip route add 192.169.3.0/24 via 192.168.2.1

should work.

Keep in mind that firewall rules could block access even with a working route, verify connectability with ping .

Unfortunately, this also doesn't seem to have worked. I don't think this is a firewall issue, as the VPN provider have confirmed that by default the VPN app will allow all local networks, and it is simply that my machine is using the VPN  gateway as the default gateway when the tunnel is up. ip route now shows an additional

192.169.3.0/24 via 192.168.2.1 dev wlp0s20f3 

but any attempt to SSH to the 192.168.3.0/24 network while the VPN is active still results in no route to host.

Offline

#4 2020-01-23 12:56:59

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,975
Website

Re: Bypassing VPN using a routing table entry.

Try:

$ ip route add 192.168.3.0/24 via 192.168.2.1

instead.


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#5 2020-01-23 14:05:36

drossbox
Member
Registered: 2019-12-04
Posts: 22

Re: Bypassing VPN using a routing table entry.

schard wrote:

Try:

$ ip route add 192.168.3.0/24 via 192.168.2.1

instead.

Jesus, thanks lol. I really couldn't understand why that hadn't worked, and I'm not sure when/if I would have spotted that!

Offline

#6 2020-01-23 23:00:44

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Bypassing VPN using a routing table entry.

Sorry for that, drossbox.
Last time I made such an embarrassing typo is long ago.

Do things work now ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2020-01-24 07:59:14

drossbox
Member
Registered: 2019-12-04
Posts: 22

Re: Bypassing VPN using a routing table entry.

Yeah, all working - thanks a lot! Can't believe I hadn't noticed either!

Offline

Board footer

Powered by FluxBB