Gentoo Archives: gentoo-user

From: Hilco Wijbenga <hilco.wijbenga@×××××.com>
To: Gentoo User <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Enable "regular" network traffic when using VPN
Date: Sat, 09 Jun 2018 00:20:41
Message-Id: CAE1pOi3tiPNTrbHquXny+wJ4_x60M38j_2e0LzmJZJ-j-c4+xg@mail.gmail.com
In Reply to: Re: [gentoo-user] Enable "regular" network traffic when using VPN by Mick
1 On Fri, Jun 8, 2018 at 4:34 PM Mick <michaelkintzios@×××××.com> wrote:
2 >
3 > On Friday, 8 June 2018 23:21:52 BST Grant Taylor wrote:
4 > > On 06/08/2018 03:31 PM, Hilco Wijbenga wrote:
5 > > > Sigh, I take it back. That causes the internal sites to no longer work.
6 > >
7 > > Okay.
8 > >
9 > > So you're on the proper track.
10 > >
11 > > I'm guessing the work network isn't a simple single prefix. Or at least
12 > > the VPN client doesn't route enough through the VPN.
13 > >
14 > > Check your routing table with the VPN connected. Is enough being routed
15 > > through? Do you need to add additional prefixes?
16 > >
17 > > If DNS is working properly for internal resources, make sure that what
18 > > they resolve to is routed through the VPN.
19 >
20 > I don't know what networkmanager offers in terms of VPN settings, but as Grant
21 > says you need to set split routing. As it currently is, everything is sent
22 > out through the tunnel and your work's router is not set up to route out to
23 > the Internet your VPN connection.
24 >
25 > If networkmanager does not get you what you want, you can do this with 'ip
26 > route'. Delete the default route, then set again the default route via the
27 > your local gateway:
28 >
29 > # ip route del default via 192.168.1.254 dev wlan0
30 > # ip route add default via 192.168.1.254 dev wlan0
31 >
32 > then create an additional route for the remote subnet if it's not there:
33 >
34 > # ip route add 10.10.20.0/24 via 172.16.1.1 dev wlan0
35 >
36 > Where 10.10.20.0/24 is your work's subnet and 172.16.1.1 is the local VPN IP
37 > address for your PC. Something along these lines ought to work.
38
39 I fooled around with "ip" but while removing ("del default") was easy,
40 "add default" did not seem to do anything.
41
42 Let me give some more information, perhaps that will help.
43
44 Setup without VPN
45 $ ip route
46 default via 192.168.151.1 dev eth0 proto static metric 100
47 127.0.0.0/8 via 127.0.0.1 dev lo
48 192.168.151.0/24 dev eth0 proto kernel scope link src 192.168.151.103 metric 100
49
50 (192.168.151.1 is my own gateway, an old computer functioning as router)
51
52
53 Setup with VPN (Gateway: vpn.company.com; Other DNS Servers:
54 dns1,dns2; Search Domains:
55 r1.i.company.com,r2.i.company.com,r3.i.company.com,r4.i.company.com,r5.i.company.com,r6.i.company.com,r7.i.company.com,r8.i.company.com,i.company.com,config)
56 $ ip route
57 default via 192.168.151.1 dev eth0 proto static metric 100
58 $SOME_COMPANY_IP_1 dev tun0 proto kernel scope link src
59 $SOME_COMPANY_IP_1 metric 50
60 127.0.0.0/8 via 127.0.0.1 dev lo
61 192.168.151.0/24 dev eth0 proto kernel scope link src 192.168.151.103 metric 100
62 192.168.151.1 dev eth0 proto static scope link metric 100
63 $VPN_GATEWAY via 192.168.151.1 dev eth0 proto static metric 100
64
65 (where $SOME_COMPANY_IP is the IP of some internal server, and
66 $VPN_GATEWAY is the IP of vpn.company.com).
67 ==> This does _not_ allow me to access (e.g.) *.i.company.com but
68 everything else works fine.
69
70
71 Same setup but without "Use only for resources on this connection":
72 $ ip route
73 default dev tun0 proto static scope link metric 50
74 default via 192.168.151.1 dev eth0 proto static metric 100
75 $SOME_COMPANY_IP_2 dev tun0 proto kernel scope link src
76 $SOME_COMPANY_IP_2 metric 50
77 127.0.0.0/8 via 127.0.0.1 dev lo
78 192.168.151.0/24 dev eth0 proto kernel scope link src 192.168.151.103 metric 100
79 192.168.151.1 dev eth0 proto static scope link metric 100
80 $VPN_GATEWAY via 192.168.151.1 dev eth0 proto static metric 100
81
82 (note that $SOME_COMPANY_IP_1 and $SOME_COMPANY_IP_2 differ only in
83 the last digit; this seems to go up by one every time I connect to
84 VPN, so probably irrelevant)
85 ==> This allows me to access *.i.company.com but breaks everything else.
86
87
88 What would be the "correct" output for "ip route"?

Replies

Subject Author
Re: [gentoo-user] Enable "regular" network traffic when using VPN Grant Taylor <gtaylor@×××××××××××××××××××××.net>
Re: [gentoo-user] Enable "regular" network traffic when using VPN Mick <michaelkintzios@×××××.com>
Re: [gentoo-user] Enable "regular" network traffic when using VPN Mick <michaelkintzios@×××××.com>