N
N
Nikolay Baranenko2019-01-22 09:02:44
Debian
Nikolay Baranenko, 2019-01-22 09:02:44

How to properly separate VPN and Internet network routes?

Hello.
Network routes without vpn look like this

[email protected]:/home/drno/musor/openconnect-master# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.254   0.0.0.0         UG    600    0        0 wlp2s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 wlp2s0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp2s0

after establishing a vpn connection, another vpn0 interface appears
[email protected]:/home/drno/musor/openconnect-master# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         0.0.0.0         0.0.0.0         U     50     0        0 vpn0
default         192.168.1.254   0.0.0.0         UG    600    0        0 wlp2s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 wlp2s0
113.13.13.0     0.0.0.0         255.255.254.0   U     50     0        0 vpn0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp2s0
192.168.1.254   0.0.0.0         255.255.255.255 UH    600    0        0 wlp2s0
supervpn.my.ru     192.168.1.254   255.255.255.255 UGH   600    0        0 wlp2s0

in fact, calls to 11.0.0.0 need to be sent to 113.13.13.0
How to separate VPN and Internet network routes?
ps
does not help
route del -net 0.0.0.0 netmask 0.0.0.0 vpn0
route add -net 11.0.0.0 netmask 255.0.0.0 vpn0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay Baranenko, 2020-01-20
@drno-reg

for Linux

sudo ip route del default dev vpn0
sudo ip route add 11.0.0.0/8 dev vpn0

for Windows
route add 10.0.0.0 MASK 255.0.0.0 172.18.18.1
route delete 0.0.0.0  mask 0.0.0.0 172.18.18.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question