I'm trying to setting a VPN on Linux Mint 19.2.
I'm using the network-manager-strongswan so I added this file named VPN under /etc/NetworkManager/system-connections/
[connection]
id=VPN
uuid=be1d4fd1-bbaa-4aa9-9fdc-e293bf16fe67
type=vpn
autoconnect=false
permissions=
timestamp=1582680217
[vpn]
address=vpn********.it
certificate=
encap=yes
ipcomp=no
method=eap
password-flags=0
proposal=no
user=user
virtual=yes
service-type=org.freedesktop.NetworkManager.strongswan
[vpn-secrets]
password=password
[ipv4]
dns-search=
ignore-auto-dns=true
ignore-auto-routes=true
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
method=ignore
The connection is fine, I can access using ssh on the private network. The big issue is that after the connection I can't surf the internet, connecting to the vpn lock all other addresses.
I added the ignore-auto-routes
flag in the config so why my connection is locked?
ip a output*
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:3c:de:1b brd ff:ff:ff:ff:ff:ff
inet yy.16.209.132/24 brd yy.16.209.255 scope global dynamic noprefixroute ens33
valid_lft 1656sec preferred_lft 1656sec
inet yy.26.199.18/32 scope global ens33
valid_lft forever preferred_lft forever
inet6 fe80::216e:bcc0:3b4f:44b2/64 scope link noprefixroute
valid_lft forever preferred_lft forever
route -n output
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 yy.16.209.2 0.0.0.0 UG 20100 0 0 ens33
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 ens33
yy.16.209.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
yy.26.199.18 0.0.0.0 255.255.255.255 UH 50 0 0 ens33
yy.26.199.18 0.0.0.0 255.255.255.255 UH 100 0 0 ens33
ip xfrm policy output NO VPN
src yy.16.209.0/24 dst yy.16.209.0/24
dir fwd priority 175423
src yy.16.209.0/24 dst yy.16.209.0/24
dir in priority 175423
src yy.16.209.0/24 dst yy.16.209.0/24
dir out priority 175423
src 169.254.0.0/16 dst 169.254.0.0/16
dir fwd priority 183615
src 169.254.0.0/16 dst 169.254.0.0/16
dir in priority 183615
src 169.254.0.0/16 dst 169.254.0.0/16
dir out priority 183615
src fe80::/64 dst fe80::/64
dir fwd priority 134463
src fe80::/64 dst fe80::/64
dir in priority 134463
src fe80::/64 dst fe80::/64
dir out priority 134463
src yy.26.199.18/32 dst 0.0.0.0/0
dir out priority 383615
tmpl src yy.16.209.132 dst xx.xx.124.58
proto esp spi 0xc57cfb3f reqid 7 mode tunnel
src 0.0.0.0/0 dst yy.26.199.18/32
dir fwd priority 383615
tmpl src xx.xx.124.58 dst yy.16.209.132
proto esp reqid 7 mode tunnel
src 0.0.0.0/0 dst yy.26.199.18/32
dir in priority 383615
tmpl src xx.xx.124.58 dst yy.16.209.132
proto esp reqid 7 mode tunnel
src ::1/128 dst ::1/128
dir fwd priority 68927
src ::1/128 dst ::1/128
dir in priority 68927
src ::1/128 dst ::1/128
dir out priority 68927
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
ip xfrm policy output UNDER VPN
src yy.26.199.18/32 dst 0.0.0.0/0
dir out priority 383615
tmpl src yy.16.209.132 dst xx.xx.124.58
proto esp spi 0xc787ea42 reqid 2 mode tunnel
src 0.0.0.0/0 dst yy.26.199.18/32
dir fwd priority 383615
tmpl src xx.xx.124.58 dst yy.16.209.132
proto esp reqid 2 mode tunnel
src 0.0.0.0/0 dst yy.26.199.18/32
dir in priority 383615
tmpl src xx.xx.124.58 dst yy.16.209.132
proto esp reqid 2 mode tunnel
src fe80::/64 dst fe80::/64
dir fwd priority 134463
src fe80::/64 dst fe80::/64
dir in priority 134463
src fe80::/64 dst fe80::/64
dir out priority 134463
src ::1/128 dst ::1/128
dir fwd priority 68927
src ::1/128 dst ::1/128
dir in priority 68927
src ::1/128 dst ::1/128
dir out priority 68927
src yy.16.209.0/24 dst yy.16.209.0/24
dir fwd priority 175423
src yy.16.209.0/24 dst yy.16.209.0/24
dir in priority 175423
src yy.16.209.0/24 dst yy.16.209.0/24
dir out priority 175423
src 169.254.0.0/16 dst 169.254.0.0/16
dir fwd priority 183615
src 169.254.0.0/16 dst 169.254.0.0/16
dir in priority 183615
src 169.254.0.0/16 dst 169.254.0.0/16
dir out priority 183615
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket in priority 0
src 0.0.0.0/0 dst 0.0.0.0/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
src ::/0 dst ::/0
socket in priority 0
src ::/0 dst ::/0
socket out priority 0
Diffing the outputs I can see this piece is added while the VPN is connected:
src yy.26.199.18/32 dst 0.0.0.0/0
dir out priority 383615
tmpl src yy.16.209.132 dst xx.xx.124.58
proto esp spi 0xc787ea42 reqid 2 mode tunnel
src 0.0.0.0/0 dst yy.26.199.18/32
dir fwd priority 383615
tmpl src xx.xx.124.58 dst yy.16.209.132
proto esp reqid 2 mode tunnel
src 0.0.0.0/0 dst yy.26.199.18/32
dir in priority 383615
tmpl src xx.xx.124.58 dst yy.16.209.132
proto esp reqid 2 mode tunnel
I tried a lot of things but with no luck.
- tried to increase the
Metric
for yy.26.199.18 to 1050 and 1100. route del default
&&ip route add default via yy.26.199.18 dev ens33
- Tried to delete the route entries yy.26.199.18 but nothing changes
and a lot of others stupid stuff.
So I want to use my connection for the "normal internet" while routing specific addresses through VPN.
It is possible?