From d9150d375c7dc7a25f9724f9980db878941b0ede Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 20 Aug 2012 19:34:05 +0200 Subject: [PATCH] openggsn-config: Add the GGSN configuration to this layer --- .../openggsn-config/files/sysmobsc/ggsn.conf | 88 +++++++++++++++++++ .../files/sysmobsc/gprs_routing | 23 +++++ .../files/sysmobts-v1/ggsn.conf | 88 +++++++++++++++++++ .../files/sysmobts-v1/gprs_routing | 23 +++++ .../files/sysmobts-v2/ggsn.conf | 88 +++++++++++++++++++ .../files/sysmobts-v2/gprs_routing | 23 +++++ .../openggsn-config/gprs-routing_0.1.bb | 20 +++++ .../sysmocom-ggsn-config_0.1.bb | 11 +++ 8 files changed, 364 insertions(+) create mode 100644 recipes-config/openggsn-config/files/sysmobsc/ggsn.conf create mode 100755 recipes-config/openggsn-config/files/sysmobsc/gprs_routing create mode 100644 recipes-config/openggsn-config/files/sysmobts-v1/ggsn.conf create mode 100755 recipes-config/openggsn-config/files/sysmobts-v1/gprs_routing create mode 100644 recipes-config/openggsn-config/files/sysmobts-v2/ggsn.conf create mode 100755 recipes-config/openggsn-config/files/sysmobts-v2/gprs_routing create mode 100644 recipes-config/openggsn-config/gprs-routing_0.1.bb create mode 100644 recipes-config/openggsn-config/sysmocom-ggsn-config_0.1.bb diff --git a/recipes-config/openggsn-config/files/sysmobsc/ggsn.conf b/recipes-config/openggsn-config/files/sysmobsc/ggsn.conf new file mode 100644 index 0000000..138e7af --- /dev/null +++ b/recipes-config/openggsn-config/files/sysmobsc/ggsn.conf @@ -0,0 +1,88 @@ +############################################################################## +# +# Sample ggsn configuration file +# +############################################################################## + +# TAG: fg +# Include this flag if process is to run in the foreground +# +#fg + +# TAG: debug +# Include this flag to include debug information. +#debug + + +# TAG: conf +# Configuration file to use. This file is the configuration file, +# so changing this parameter in the configuration file does not make +# sense. Use it on the command line instead. + +# TAG: pidfile +# File to store information about the process id of the program. +# The program must have write access to this file/directory. +#pidfile /var/run/ggsn.pid + +# TAG: statedir +# Directory to use for nonvolatile storage. +# The program must have write access to this directory. +#statedir /var/lib/ggsn/ + + +# TAG: listen +# Specifies the local IP address to listen to +#listen 10.0.0.240 +listen 10.23.123.1 + +# TAG: net +# IP network address of external packet data network +# Used to set up network interface. +net 10.23.42.0/24 + +# TAG: ipup +# Script executed after network interface has been brought up. +# Executed with the following parameters: +#ipup /etc/ggsn/ip-up + +# TAG: ipdown +# Script executed after network interface has been taken down. +# Executed with the following parameters: +#ipdown /etc/ggsn/ip-down + +# TAG: dynip +# Dynamic IP address pool. +# Used for allocation of dynamic IP address when address is not given +# by HLR. +# If this option is not given then the net option is used as a substitute. +#dynip 192.168.0.0/24 + +# TAG: statip +# Use of this tag is currently UNSUPPORTED +# Static IP address pool. +# Used for allocation of static IP address by means of HLR. +#statip 192.168.1.0/24 + +# TAG: pcodns1 +# Protocol configuration option domain name system server 1. +pcodns1 8.8.8.8 + +# TAG: pcodns2 +# Protocol configuration option domain name system server 2. +#pcodns2 0.0.0.0 + +# TAG: timelimit +# Exit after timelimit seconds. +# Setting timelimit to zero will cause the program not to exit. +#timelimit 0 + +# TAG: apn +# Use of this tag is EXPERIMENTAL +# Access point name to connect to when run in client mode. +#apn internet + +# TAG: qos +# Use of this tag is EXPERIMENTAL +# Requested Quality of Service used when run in client mode. +# 3 bytes corresponding to ???? +#qos 0x0b921f diff --git a/recipes-config/openggsn-config/files/sysmobsc/gprs_routing b/recipes-config/openggsn-config/files/sysmobsc/gprs_routing new file mode 100755 index 0000000..016b425 --- /dev/null +++ b/recipes-config/openggsn-config/files/sysmobsc/gprs_routing @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME=gprs_routing + +set -e + +case "$1" in + start) + echo 1 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE + echo "Enabled masquerading" + ;; + stop) + echo 0 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 +esac + +exit 0 diff --git a/recipes-config/openggsn-config/files/sysmobts-v1/ggsn.conf b/recipes-config/openggsn-config/files/sysmobts-v1/ggsn.conf new file mode 100644 index 0000000..138e7af --- /dev/null +++ b/recipes-config/openggsn-config/files/sysmobts-v1/ggsn.conf @@ -0,0 +1,88 @@ +############################################################################## +# +# Sample ggsn configuration file +# +############################################################################## + +# TAG: fg +# Include this flag if process is to run in the foreground +# +#fg + +# TAG: debug +# Include this flag to include debug information. +#debug + + +# TAG: conf +# Configuration file to use. This file is the configuration file, +# so changing this parameter in the configuration file does not make +# sense. Use it on the command line instead. + +# TAG: pidfile +# File to store information about the process id of the program. +# The program must have write access to this file/directory. +#pidfile /var/run/ggsn.pid + +# TAG: statedir +# Directory to use for nonvolatile storage. +# The program must have write access to this directory. +#statedir /var/lib/ggsn/ + + +# TAG: listen +# Specifies the local IP address to listen to +#listen 10.0.0.240 +listen 10.23.123.1 + +# TAG: net +# IP network address of external packet data network +# Used to set up network interface. +net 10.23.42.0/24 + +# TAG: ipup +# Script executed after network interface has been brought up. +# Executed with the following parameters: +#ipup /etc/ggsn/ip-up + +# TAG: ipdown +# Script executed after network interface has been taken down. +# Executed with the following parameters: +#ipdown /etc/ggsn/ip-down + +# TAG: dynip +# Dynamic IP address pool. +# Used for allocation of dynamic IP address when address is not given +# by HLR. +# If this option is not given then the net option is used as a substitute. +#dynip 192.168.0.0/24 + +# TAG: statip +# Use of this tag is currently UNSUPPORTED +# Static IP address pool. +# Used for allocation of static IP address by means of HLR. +#statip 192.168.1.0/24 + +# TAG: pcodns1 +# Protocol configuration option domain name system server 1. +pcodns1 8.8.8.8 + +# TAG: pcodns2 +# Protocol configuration option domain name system server 2. +#pcodns2 0.0.0.0 + +# TAG: timelimit +# Exit after timelimit seconds. +# Setting timelimit to zero will cause the program not to exit. +#timelimit 0 + +# TAG: apn +# Use of this tag is EXPERIMENTAL +# Access point name to connect to when run in client mode. +#apn internet + +# TAG: qos +# Use of this tag is EXPERIMENTAL +# Requested Quality of Service used when run in client mode. +# 3 bytes corresponding to ???? +#qos 0x0b921f diff --git a/recipes-config/openggsn-config/files/sysmobts-v1/gprs_routing b/recipes-config/openggsn-config/files/sysmobts-v1/gprs_routing new file mode 100755 index 0000000..016b425 --- /dev/null +++ b/recipes-config/openggsn-config/files/sysmobts-v1/gprs_routing @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME=gprs_routing + +set -e + +case "$1" in + start) + echo 1 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE + echo "Enabled masquerading" + ;; + stop) + echo 0 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 +esac + +exit 0 diff --git a/recipes-config/openggsn-config/files/sysmobts-v2/ggsn.conf b/recipes-config/openggsn-config/files/sysmobts-v2/ggsn.conf new file mode 100644 index 0000000..138e7af --- /dev/null +++ b/recipes-config/openggsn-config/files/sysmobts-v2/ggsn.conf @@ -0,0 +1,88 @@ +############################################################################## +# +# Sample ggsn configuration file +# +############################################################################## + +# TAG: fg +# Include this flag if process is to run in the foreground +# +#fg + +# TAG: debug +# Include this flag to include debug information. +#debug + + +# TAG: conf +# Configuration file to use. This file is the configuration file, +# so changing this parameter in the configuration file does not make +# sense. Use it on the command line instead. + +# TAG: pidfile +# File to store information about the process id of the program. +# The program must have write access to this file/directory. +#pidfile /var/run/ggsn.pid + +# TAG: statedir +# Directory to use for nonvolatile storage. +# The program must have write access to this directory. +#statedir /var/lib/ggsn/ + + +# TAG: listen +# Specifies the local IP address to listen to +#listen 10.0.0.240 +listen 10.23.123.1 + +# TAG: net +# IP network address of external packet data network +# Used to set up network interface. +net 10.23.42.0/24 + +# TAG: ipup +# Script executed after network interface has been brought up. +# Executed with the following parameters: +#ipup /etc/ggsn/ip-up + +# TAG: ipdown +# Script executed after network interface has been taken down. +# Executed with the following parameters: +#ipdown /etc/ggsn/ip-down + +# TAG: dynip +# Dynamic IP address pool. +# Used for allocation of dynamic IP address when address is not given +# by HLR. +# If this option is not given then the net option is used as a substitute. +#dynip 192.168.0.0/24 + +# TAG: statip +# Use of this tag is currently UNSUPPORTED +# Static IP address pool. +# Used for allocation of static IP address by means of HLR. +#statip 192.168.1.0/24 + +# TAG: pcodns1 +# Protocol configuration option domain name system server 1. +pcodns1 8.8.8.8 + +# TAG: pcodns2 +# Protocol configuration option domain name system server 2. +#pcodns2 0.0.0.0 + +# TAG: timelimit +# Exit after timelimit seconds. +# Setting timelimit to zero will cause the program not to exit. +#timelimit 0 + +# TAG: apn +# Use of this tag is EXPERIMENTAL +# Access point name to connect to when run in client mode. +#apn internet + +# TAG: qos +# Use of this tag is EXPERIMENTAL +# Requested Quality of Service used when run in client mode. +# 3 bytes corresponding to ???? +#qos 0x0b921f diff --git a/recipes-config/openggsn-config/files/sysmobts-v2/gprs_routing b/recipes-config/openggsn-config/files/sysmobts-v2/gprs_routing new file mode 100755 index 0000000..016b425 --- /dev/null +++ b/recipes-config/openggsn-config/files/sysmobts-v2/gprs_routing @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME=gprs_routing + +set -e + +case "$1" in + start) + echo 1 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE + echo "Enabled masquerading" + ;; + stop) + echo 0 > /proc/sys/net/ipv4/ip_forward + iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 +esac + +exit 0 diff --git a/recipes-config/openggsn-config/gprs-routing_0.1.bb b/recipes-config/openggsn-config/gprs-routing_0.1.bb new file mode 100644 index 0000000..c6250b0 --- /dev/null +++ b/recipes-config/openggsn-config/gprs-routing_0.1.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "OpenGGSN GPRS routing to the real world" +RDEPENDS = "iptables kernel-module-ipt-masquerade" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" + +SRC_URI = "file://gprs_routing" + + +inherit update-rc.d + +INITSCRIPT_PACKAGES = "${PN}" +INITSCRIPT_NAME_${PN} = "gprs_routing" +INITSCRIPT_PARAMS_${PN} = "defaults 28 28" + + +do_install() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/gprs_routing ${D}${sysconfdir}/init.d/gprs_routing +} diff --git a/recipes-config/openggsn-config/sysmocom-ggsn-config_0.1.bb b/recipes-config/openggsn-config/sysmocom-ggsn-config_0.1.bb new file mode 100644 index 0000000..637719c --- /dev/null +++ b/recipes-config/openggsn-config/sysmocom-ggsn-config_0.1.bb @@ -0,0 +1,11 @@ +DESCRIPTION = "OpenGGSN config by sysmocom" +SRC_URI = "file://ggsn.conf" +LICENSE = "closed" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" + +do_install() { + install -d ${D}${sysconfdir} + install -m 0660 ${WORKDIR}/ggsn.conf ${D}${sysconfdir}/ +} + +CONFFILES_${PN} = "${sysconfdir}/ggsn.conf"