Neels Hofmeyr | 65d61c3 | 2017-11-11 19:36:48 +0100 | [diff] [blame] | 1 | == Running OsmoGGSN |
Harald Welte | 8a1e7b8 | 2017-09-06 12:35:04 +0200 | [diff] [blame] | 2 | |
| 3 | The OsmoGGSN executable (`osmo-ggsn`) offers the following command-line |
| 4 | arguments: |
| 5 | |
| 6 | === SYNOPSIS |
| 7 | |
| 8 | *osmo-ggsn* [-h|-V] [-D] [-c 'CONFIGFILE'] |
| 9 | |
| 10 | === OPTIONS |
| 11 | |
| 12 | *-h, --help*:: |
| 13 | Print a short help message about the supported options |
| 14 | *-V, --version*:: |
| 15 | Print the compile-time version number of the OsmoBTS program |
| 16 | *-D, --daemonize*:: |
| 17 | Fork the process as a daemon into background. |
| 18 | *-c, --config-file 'CONFIGFILE'*:: |
| 19 | Specify the file and path name of the configuration file to be |
| 20 | used. If none is specified, use `osmo-ggsn.cfg` in the current |
| 21 | working directory. |
| 22 | |
Neels Hofmeyr | 6068375 | 2017-11-18 17:37:09 +0100 | [diff] [blame^] | 23 | === Routing |
| 24 | |
| 25 | Operating the OpenGGSN tun device naturally creates a network setup with |
| 26 | multiple interfaces. Consider: |
| 27 | |
| 28 | * Typical Linux setups prevent forwarding of packets between separate |
| 29 | interfaces by default. To let subscribers reach the internet uplink from the |
| 30 | tun device, it may be required to enable IP forwarding. |
| 31 | |
| 32 | * Having a locally defined address range assigned to the tun device requires |
| 33 | either sensible routing for this address range, or that masquerading is |
| 34 | enabled to allow your single uplink IP address to "proxy" for the tun. |
| 35 | |
| 36 | These are decisions to be made on a network administration level. |
| 37 | |
| 38 | In a trivial case where you have a single box serving GPRS to few subscribers |
| 39 | on an arbitrary IP address range not known in the larger network, the easiest |
| 40 | way to enable GPRS uplink would be to enable IP forwarding and masquerading. |
| 41 | |
| 42 | To manually enable IPv4 forwarding and masquerading ad-hoc, you can do: |
| 43 | |
| 44 | ---- |
| 45 | sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" |
| 46 | iptables -t nat -A POSTROUTING -o '*' -j MASQUERADE |
| 47 | ---- |
| 48 | |
| 49 | (You may want to replace `*` with the network device name, like `-o eth0`) |
| 50 | |
| 51 | There are various ways to enable these settings persistently, please refer to |
| 52 | your distribution's documentation -- e.g. look for @net.ipv4.ip_forward=1@ in |
| 53 | @/etc/sysctl.d/@, and https://wiki.debian.org/iptables for masquerading. |
| 54 | |
Harald Welte | 8a1e7b8 | 2017-09-06 12:35:04 +0200 | [diff] [blame] | 55 | === Multiple instances |
| 56 | |
| 57 | Running multiple instances of `osmo-ggsn` is possible if all GGSN instances |
| 58 | are binding to different local IP addresse and all other interfaces (VTY, |
| 59 | OML) are separated using the appropriate configuration options. The IP based |
| 60 | interfaces are binding to local host by default. In order to separate the |
| 61 | processes, the user has to bind those services to specific but different |
| 62 | IP addresses. |
| 63 | |
| 64 | The VTY and the control interface can be bound to IP addresses from the loopback |
| 65 | address range. |
| 66 | |
| 67 | .Example: Binding VTY and control interface to a specific ip-address |
| 68 | ---- |
| 69 | line vty |
| 70 | bind 127.0.0.2 |
| 71 | ctrl |
| 72 | bind 127.0.0.2 |
| 73 | ---- |
Neels Hofmeyr | 5f8b332 | 2017-11-12 22:50:00 +0100 | [diff] [blame] | 74 | |
| 75 | Also make sure to place each instance's GTP bind on a separate IP address (GTP |
| 76 | uses a port number that is fixed in the GTP specifications, so it will not be |
| 77 | possible to pick differing ports on the same IP address), like: |
| 78 | |
| 79 | ---- |
| 80 | ggsn ggsn0 |
| 81 | gtp bind-ip 127.0.0.2 |
| 82 | ---- |