I'm trying to setup a VPN using network manager. When I run openvpn manually with my config, it works fine (sudo openvpn --config MyVPN.ovpn
). Then when I print the routes (sudo route -n
), it gives me:
Destination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 192.168.1.254 0.0.0.0 UG 600 0 0 wlp3s010.c.d.0 172.a.b.1 255.255.255.0 UG 0 0 0 tun010.e.f.0 172.a.b.1 255.255.255.0 UG 0 0 0 tun0169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp3s0172.a.b.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp3s0
When I use network manager (with the openvpn plugin), I get am missing the 10. gateway routes.
I checked Use this connection only for resources on its network
for both ipv4 and 6 (I don't want all my traffic to go through that VPN).
Why am I missing routes with network manager?
I'm using Linux Mint 18.2, network manager 1.2.6-0ubuntu0.16.04.1 and openvpn2.3.10-1ubuntu2.1
Here's my tail -f /var/log/syslog
when i'm using NM:
Sep 6 12:32:05 MyMint NetworkManager[867]: <info> [1504693925.1089] audit: op="connection-activate" uuid="d4e40650-bc76-4139-a92f-ab51276287e2" name="MyVPN" pid=15515 uid=1000 result="success"Sep 6 12:32:05 MyMint NetworkManager[867]: <info> [1504693925.1171] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",0]: Started the VPN service, PID 31326Sep 6 12:32:05 MyMint NetworkManager[867]: <info> [1504693925.1314] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",0]: Saw the service appear; activating connectionSep 6 12:32:12 MyMint NetworkManager[867]: <info> [1504693932.3783] keyfile: update /etc/NetworkManager/system-connections/MyVPN (d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN")Sep 6 12:32:12 MyMint NetworkManager[867]: nm-openvpn-Message: openvpn[31341] startedSep 6 12:32:12 MyMint NetworkManager[867]: <info> [1504693932.3865] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",0]: VPN plugin: state changed: starting (3)Sep 6 12:32:12 MyMint NetworkManager[867]: <info> [1504693932.3866] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",0]: VPN connection: (ConnectInteractive) reply receivedSep 6 12:32:12 MyMint nm-openvpn[31341]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017Sep 6 12:32:12 MyMint nm-openvpn[31341]: library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08Sep 6 12:32:12 MyMint nm-openvpn[31341]: NOTE: the current --script-security setting may allow this configuration to call user-defined scriptsSep 6 12:32:12 MyMint nm-openvpn[31341]: WARNING: file '/home/laurian/MyVPN/MyVPN.key' is group or others accessibleSep 6 12:32:12 MyMint nm-openvpn[31341]: NOTE: chroot will be delayed because of --client, --pull, or --up-delaySep 6 12:32:12 MyMint nm-openvpn[31341]: NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delaySep 6 12:32:12 MyMint nm-openvpn[31341]: UDPv4 link local: [undef]Sep 6 12:32:12 MyMint nm-openvpn[31341]: UDPv4 link remote: [AF_INET]170.75.241.82:1194Sep 6 12:32:14 MyMint nm-openvpn[31341]: [MyVPN] Peer Connection Initiated with [AF_INET]170.75.241.82:1194Sep 6 12:32:16 MyMint nm-openvpn[31341]: TUN/TAP device tun0 openedSep 6 12:32:16 MyMint nm-openvpn[31341]: /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper --bus-name org.freedesktop.NetworkManager.openvpn.Connection_8 --tun -- tun0 1500 1558 172.a.b.4 255.255.255.0 initSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7477] manager: (tun0): new Tun device (/org/freedesktop/NetworkManager/Devices/8)Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7562] devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7562] device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7796] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",0]: VPN connection: (IP Config Get) reply received.Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7852] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: VPN connection: (IP4 Config Get) reply receivedSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7861] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: VPN Gateway: 170.x.y.zSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7862] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Tunnel Device: "tun0"Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7862] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: IPv4 configuration:Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7862] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Internal Gateway: 172.a.b.1Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7862] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Internal Address: 172.a.b.4Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7862] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Internal Prefix: 24Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7862] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Internal Point-to-Point Address: 172.a.b.4Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7862] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Maximum Segment Size (MSS): 0Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7863] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Static Route: 10.c.d.0/24 Next Hop: 172.a.b.1Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7863] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Static Route: 10.e.f.0/24 Next Hop: 172.a.b.1Sep 6 12:32:16 MyMint nm-openvpn[31341]: chroot to '/var/lib/openvpn/chroot' and cd to '/' succeededSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7863] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: Forbid Default Route: yesSep 6 12:32:16 MyMint nm-openvpn[31341]: GID set to nm-openvpnSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7863] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: DNS Domain: '(none)'Sep 6 12:32:16 MyMint nm-openvpn[31341]: UID set to nm-openvpnSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7863] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: Data: No IPv6 configurationSep 6 12:32:16 MyMint nm-openvpn[31341]: Initialization Sequence CompletedSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7864] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: VPN plugin: state changed: started (4)Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7890] vpn-connection[0x1ba5460,d4e40650-bc76-4139-a92f-ab51276287e2,"MyVPN",9:(tun0)]: VPN connection: (IP Config Get) completeSep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.7893] device (tun0): state change: unmanaged -> unavailable (reason 'connection-assumed') [10 20 41]Sep 6 12:32:16 MyMint dbus[823]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8035] keyfile: add connection in-memory (6cc36f83-a713-494f-a153-8c0ef8482c23,"tun0")Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8041] device (tun0): state change: unavailable -> disconnected (reason 'connection-assumed') [20 30 41]Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8061] device (tun0): Activation: starting connection 'tun0' (6cc36f83-a713-494f-a153-8c0ef8482c23)Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8070] device (tun0): state change: disconnected -> prepare (reason 'none') [30 40 0]Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8075] device (tun0): state change: prepare -> config (reason 'none') [40 50 0]Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8078] device (tun0): state change: config -> ip-config (reason 'none') [50 70 0]Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8081] device (tun0): state change: ip-config -> ip-check (reason 'none') [70 80 0]Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8088] device (tun0): state change: ip-check -> secondaries (reason 'none') [80 90 0]Sep 6 12:32:16 MyMint systemd[1]: Starting Network Manager Script Dispatcher Service...Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8132] device (tun0): state change: secondaries -> activated (reason 'none') [90 100 0]Sep 6 12:32:16 MyMint NetworkManager[867]: <info> [1504693936.8238] device (tun0): Activation: successful, device activated.Sep 6 12:32:16 MyMint dbus[823]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'Sep 6 12:32:16 MyMint systemd[1]: Started Network Manager Script Dispatcher Service.Sep 6 12:32:16 MyMint nm-dispatcher: req:1 'vpn-up' [tun0]: new request (1 scripts)Sep 6 12:32:16 MyMint nm-dispatcher: req:1 'vpn-up' [tun0]: start running ordered scripts...Sep 6 12:32:16 MyMint nm-dispatcher: req:2 'up' [tun0]: new request (1 scripts)Sep 6 12:32:16 MyMint nm-dispatcher: req:2 'up' [tun0]: start running ordered scripts...Sep 6 12:32:16 MyMint ntpdate[31411]: the NTP socket is in use, exitingSep 6 12:32:17 MyMint ntpdate[31471]: the NTP socket is in use, exitingSep 6 12:32:17 MyMint ntpdate[31530]: the NTP socket is in use, exitingSep 6 12:32:18 MyMint ntpd[1364]: Listen normally on 28 tun0 172.a.b.4:123Sep 6 12:32:18 MyMint ntpd[1364]: Listen normally on 29 tun0 [fe80::a1e0:e276:5803:2ce5%9]:123Sep 6 12:32:18 MyMint ntpd[1364]: new interface(s) found: waking up resolver