path: root/configure.ac
diff options
authorPablo Neira Ayuso <pablo@gnumonks.org>2015-11-17 12:22:42 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-12-21 08:37:11 +0100
commit4b075b6cb85f93dff1378aabddf7c1d4959feb72 (patch)
tree897603a4b1134cb39531eba55cf104308ddb02d2 /configure.ac
parent89dcb614e81b59fb02aff7d7d86545b636def1d0 (diff)
ggsn: add support for GTP kernel data encapsulation
This patch adds the -g, --gtpnl=device option that allows you to enable the GTP kernel tunneling mode in openggsn. You have to specify the real downlink device that will be used to tunnel traffic, eg. -g=eth0 This means that the gtp0 device will be created and it will use eth0 as the real device to encapsulate packet coming from the Internet that are addressed to the MS (so the tunnel devuce encapsulates these IP packets in GTP packets when traveling to the SGSN). Alternatively, you can also add this to the ggsn.conf configuration file: gtpnl eth0 The device has to be the real device that can route packets to the SGSN, if you select the wrong device, the kernel routing code may not find a way to reach the SSGN, you've been warned. Therefore, if this option is set, the operational becomes the following: 1) A gtp0 device is created via rtnetlink and configure the socket encapsulation infrastructure in the kernel. 2) Whenever a PDP context is created, this adds the necessary tunnel configuration via genetlink GTP interface. 3) Whenever a PDP context is destroyed, this deletes the tunnel via genetlink GTP interface. 4) Destroy the gtp0 device if ggsn is stopped, including all of the existing tunnels. You require the osmo-ggsn.git tree, which contains the kernel module gtp.ko and the libgtpnl library that you have to compile and install. Make sure you have loaded the gtp.ko kernel module before launching the ggsn daemon using the kernel driver mode, otherwise you will get a nice "operation not supported" error message ;-). This patch also adds supports for "ipup" configuration option to invoke an external script after the gtp0 device has been brought up. Typical command to add the route to reach the MS behind the GGSN is required, eg. ip route add dev gtp0. The (horrible) ggsn parser has been manually extended to support the new configuration option. That code doesn't look nice, but it just mimics what we already have there for consistency, please don't blame me for that. If you want to run in debugging mode, I suggest you to use: sudo ggsn -c ggsn.conf -f -d Note that you do have to run openggsn as root to bring up the gtp0 device. You have to see this message that announce that the GTP kernel mode is enabled. openggsn[1106]: ggsn.c: 656: Using the GTP kernel mode (genl ID is 25) This patch also automagically sets up route to reach MS from Internet just like tun mode does. This is fundamental to get this working, better don't leave to the admin, he may forget to add this route. In this patch, I tried to encapsulate this new feature as much as possible as Harald initially suggested. To compile this feature, you have to pass --enable-gtp-kernel, ie. ./configire --enable-gtp-kernel Otherwise, the code to interact with the gtp kernel part is not compiled. Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Diffstat (limited to 'configure.ac')
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index cf6f562..383fa6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,17 @@ AC_SUBST(EXEC_LDADD)
# FIXME: Replace `main' with a function in `-links':
#AC_CHECK_LIB([inks], [main])
+dnl GTP kernel dependencies
+ AS_HELP_STRING([--enable-gtp-kernel], [Build GTP tunneling kernel]),
+ [enable_gtp_kernel="$enableval"], [enable_gtp_kernel="no"])
+if test "x$enable_gtp_kernel" = "xyes"; then
+ PKG_CHECK_MODULES([LIBGTPNL], [libgtpnl >= 1.0.0])
+AM_CONDITIONAL([ENABLE_GTP_KERNEL], [test "$enable_gtp_kernel" = "yes"])
# Checks for header files.
@@ -119,3 +130,7 @@ AC_CONFIG_FILES([Makefile
+echo "
+openggsn Configuration:
+ GTP kernel support: ${enable_gtp_kernel}"