After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753578 - OpenVPN configuration (.ovpn) import ignores route entries
OpenVPN configuration (.ovpn) import ignores route entries
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: VPN: openvpn
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-openvpn-options
 
 
Reported: 2015-08-13 09:00 UTC by Charles Vlk
Modified: 2015-11-27 08:05 UTC
See Also:
GNOME target: ---
GNOME version: 3.15/3.16



Description Charles Vlk 2015-08-13 09:00:13 UTC
OpenVPN configuration files can store routing information with a line like this:

route 192.168.88.0 255.255.252 192.168.88.254

This should route traffic to 192.168.88.0/22 through 192.168.88.254. NetworkManager seems to completely ignore these entries though. It is possible to look through the file and type in the route configuration manually.
Comment 1 Charles Vlk 2015-08-13 09:59:55 UTC
I meant to write 255.255.252.0 (/22) for the mask.
Comment 2 Jiri Klimes 2015-11-19 13:15:25 UTC
NetworkManager spawns openvpn with "--route-noexec" and manages routes itself. So routes are not in VPN setting and are not passed to openvpn.

However NM should support importing/exporting static routes via the "route" option and place that in IPV4 setting.
Implemented in branches:
jk/import-route-rh753578-master
jk/import-route-rh753578

(There is a difference in handling routes in libnm vs. libnm-util).
Comment 3 Thomas Haller 2015-11-19 15:04:00 UTC
jk/import-route-rh753578-master doesn't compile with NM and libnma fresh from master.


libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -DNM_OPENVPN_OLD -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_4 -I../src -DICONDIR=\"/TMP/NM-openvpn/share/pixmaps\" -DUIDIR=\"/TMP/NM-openvpn/share/gnome-vpn-properties/openvpn\" -DLOCALEDIR=\"/TMP/NM-openvpn/share/locale\" -I/opt/test/include/libnm-glib -I/opt/test/include/NetworkManager -I/opt/test/include/libnm-glib -I/opt/test/include/NetworkManager -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2 -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2 -pthread -I/opt/test/include/libnm-gtk -I/opt/test/include/libnm-glib -I/opt/test/include/NetworkManager -I/usr/include/dbus-1.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -Wall -std=gnu89 -g -Og -Wall -Wstrict-overflow -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wstrict-prototypes -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing -Wno-unused-but-set-variable -c import-export.c  -fPIC -DPIC -o .libs/libnm_openvpn_properties_la-import-export.o
import-export.c: In function ‘do_import’:
import-export.c:473:2: error: unknown type name ‘NMSettingIPConfig’
  NMSettingIPConfig *s_ip4;
Comment 4 Jiri Klimes 2015-11-19 17:13:44 UTC
(In reply to Thomas Haller from comment #3)
> jk/import-route-rh753578-master doesn't compile with NM and libnma fresh
> from master.
> 
> 
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -DNM_OPENVPN_OLD
> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
> -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -pthread
> -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0
> -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0
> -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0
> -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0
> -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
> -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
> -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm
> -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0
> -I/usr/include/libpng16 -I/usr/include/glib-2.0
> -I/usr/lib64/glib-2.0/include -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_4
> -I../src -DICONDIR=\"/TMP/NM-openvpn/share/pixmaps\"
> -DUIDIR=\"/TMP/NM-openvpn/share/gnome-vpn-properties/openvpn\"
> -DLOCALEDIR=\"/TMP/NM-openvpn/share/locale\" -I/opt/test/include/libnm-glib
> -I/opt/test/include/NetworkManager -I/opt/test/include/libnm-glib
> -I/opt/test/include/NetworkManager -I/usr/include/dbus-1.0
> -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0
> -I/usr/lib64/glib-2.0/include -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2
> -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2 -pthread
> -I/opt/test/include/libnm-gtk -I/opt/test/include/libnm-glib
> -I/opt/test/include/NetworkManager -I/usr/include/dbus-1.0
> -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0
> -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0
> -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0
> -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0
> -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
> -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
> -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm
> -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0
> -I/usr/include/libpng16 -I/usr/include/glib-2.0
> -I/usr/lib64/glib-2.0/include -Wall -std=gnu89 -g -Og -Wall
> -Wstrict-overflow -Wshadow -Wmissing-declarations -Wmissing-prototypes
> -Wdeclaration-after-statement -Wstrict-prototypes -Wfloat-equal
> -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing
> -Wno-unused-but-set-variable -c import-export.c  -fPIC -DPIC -o
> .libs/libnm_openvpn_properties_la-import-export.o
> import-export.c: In function ‘do_import’:
> import-export.c:473:2: error: unknown type name ‘NMSettingIPConfig’
>   NMSettingIPConfig *s_ip4;

It does compile.
It seems you used an old/borked config:
-I/opt/test/include/libnm-glib
-I/opt/test/include/libnm-gtk
...
try to clean and configure with the new paths.
Comment 5 Jiri Klimes 2015-11-20 11:52:04 UTC
I did not realize that we compile master both with libnm and old libnm-util for comptibility too. I have re-pushed jk/import-route-rh753578-master with dual ifdefed implementation.
Comment 6 Dan Williams 2015-11-24 20:34:46 UTC
LGTM
Comment 7 Jiri Klimes 2015-11-27 08:05:01 UTC
Committed as
master: 4eb5f3a import/export: import and export "route" option (bgo #753578)
nm-1-0: 2877624 import/export: import and export "route" option (bgo #753578)