0

My local network is 192.168.0.0/24 and I can ssh properly to the host 192.168.0.3. But after activating VPN (using vpnc) I can't ssh into above host anymore, because 192.68.0.0/24 network now points to the remote one (the one i VPNed into).

Is there any way to add exception (change in routing table maybe?) for IP 192.168.0.3 so it always points to the host in local network (not remote one) so I can ssh into it even while being connected to VPN?

Thank you.

My os: Manjaro 18.1.5 / soon to be 19
Interfaces after activating VPN:

  • enp5s0: inet 192.168.0.2/24 brd 192.168.0.255 scope global dynamic noprefixroute enp5s0
  • tun0: inet 192.168.108.151/32 scope global tun0

ip r result:

default via 192.168.0.1 dev enp5s0 proto dhcp metric 100
10.0.0.0/8 dev tun0 scope link
<IP1> via 192.168.0.1 dev enp5s0 src 192.168.0.2
172.16.0.0/12 dev tun0 scope link
192.168.0.0/24 dev enp5s0 proto kernel scope link src 192.168.0.2 metric 100
192.168.0.0/16 dev tun0 scope link
192.168.100.44 dev tun0 scope link
192.168.108.128/25 dev tun0 scope link
192.168.202.44 dev tun0 scope link

-- EDIT -- It works now, but I have no idea why. Since it works I can't verify the answers below. When the problem happens again I will try the solutions, thank you.

0

Looks like a routing issue and IP range overlap. This line strikes me as odd:

192.168.0.0/16 dev tun0 scope link

The scope is too large (/16) and overlaps with 192.168.0.0/24 that interface enp5s0 is using. Usually a 192.168.* range is /24.

Is this your VPN pushing pushing a bad route maybe ? From this line:

172.16.0.0/12 dev tun0 scope link

I gather that your VPN set up is on the 172.16. range and should not interfere with your local 192.168. range. Have a look at the VPN configuration.

1
  • The /16 would be normal if OP's remote VPN net consists of a bunch different 192.168.x subnets. – user1686 Feb 28 '20 at 13:23
0

The problem here is the metric 100 so you have two options

  1. You can remove the metric from the local network or add another metric to the remote one like 101

192.168.0.0/24 dev enp5s0 proto kernel scope link src 192.168.0.2 metric 100 <-

  1. You should remove this one or add another metric to the next one as metric 101

192.168.0.0/16 dev tun0 scope link metric 101 <-

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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