diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile.am | 3 | ||||
-rw-r--r-- | doc/examples/Makefile.am | 32 | ||||
-rw-r--r-- | doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg | 44 | ||||
-rw-r--r-- | doc/examples/osmo-gbproxy/osmo-gbproxy.cfg | 25 | ||||
-rw-r--r-- | doc/examples/osmo-gtphub/gtphub-example.txt | 90 | ||||
-rw-r--r-- | doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg | 25 | ||||
-rw-r--r-- | doc/examples/osmo-gtphub/osmo-gtphub.cfg | 25 | ||||
-rw-r--r-- | doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg | 28 | ||||
-rw-r--r-- | doc/examples/osmo-sgsn/osmo-sgsn.cfg | 30 |
9 files changed, 302 insertions, 0 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 000000000..5a231074c --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 000000000..2b5781a59 --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,32 @@ +OSMOCONF_FILES = \ + osmo-gtphub/osmo-gtphub.cfg \ + osmo-sgsn/osmo-sgsn.cfg \ + osmo-gbproxy/osmo-gbproxy.cfg + +osmoconfdir = $(sysconfdir)/osmocom +osmoconf_DATA = $(OSMOCONF_FILES) + +EXTRA_DIST = $(OSMOCONF_FILES) + +CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,' + +dist-hook: + for f in $$($(CFG_FILES)); do \ + j="$(distdir)/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +install-data-hook: + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + mkdir -p "$$(dirname $$j)" && \ + $(INSTALL_DATA) $(srcdir)/$$f $$j; \ + done + +uninstall-hook: + @$(PRE_UNINSTALL) + for f in $$($(CFG_FILES)); do \ + j="$(DESTDIR)$(docdir)/examples/$$f" && \ + $(RM) $$j; \ + done diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg new file mode 100644 index 000000000..c471c38b5 --- /dev/null +++ b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg @@ -0,0 +1,44 @@ +! +! OsmoGbProxy (UNKNOWN) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging timestamp 0 + logging level all debug + logging level gprs debug + logging level ns info + logging level bssgp debug + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice +! +line vty + no login +! +ns + nse 666 nsvci 666 + nse 666 remote-role sgsn +! nse 666 encapsulation framerelay-gre +! nse 666 remote-ip 172.16.1.70 +! nse 666 fr-dlci 666 + timer tns-block 3 + timer tns-block-retries 3 + timer tns-reset 3 + timer tns-reset-retries 3 + timer tns-test 30 + timer tns-alive 3 + timer tns-alive-retries 10 + encapsulation udp local-port 23000 +! encapsulation framerelay-gre enabled 1 +gbproxy + sgsn nsei 666 + core-mobile-country-code 666 + core-mobile-network-code 6 + core-access-point-name none match-imsi ^666066|^66607 + tlli-list max-length 200 diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg new file mode 100644 index 000000000..0c3917a3e --- /dev/null +++ b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg @@ -0,0 +1,25 @@ +! +! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty +!! +! +line vty + no login +! +gbproxy + sgsn nsei 101 +ns + nse 101 nsvci 101 + nse 101 remote-role sgsn + nse 101 encapsulation udp + nse 101 remote-ip 192.168.100.239 + nse 101 remote-port 7777 + timer tns-block 3 + timer tns-block-retries 3 + timer tns-reset 3 + timer tns-reset-retries 3 + timer tns-test 30 + timer tns-alive 3 + timer tns-alive-retries 10 + encapsulation framerelay-gre enabled 0 + encapsulation framerelay-gre local-ip 0.0.0.0 + encapsulation udp local-port 23000 diff --git a/doc/examples/osmo-gtphub/gtphub-example.txt b/doc/examples/osmo-gtphub/gtphub-example.txt new file mode 100644 index 000000000..9c65f925f --- /dev/null +++ b/doc/examples/osmo-gtphub/gtphub-example.txt @@ -0,0 +1,90 @@ +Here is a simple setup to test GTPHub operations. The IP addresses picked will +work well only on a system that creates local addresses (127.0.0.123) on the +fly (like linux) -- you may pick of course different IP addresses. + +Overview of the example setup: + + sgsnemu gtphub ggsn + 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 + +Prerequisites: openggsn. + +Have a local directory where you store config files and from which you launch +the GSNs and the hub (they will store restart counter files in that dir). +In it, have these config files: + +ggsn.conf: + + # GGSN local address + listen 127.0.0.2 + + # End User Addresses are picked from this range + net 10.23.42.0/24 + + pcodns1 8.8.8.8 + + logfile /tmp/foo + +gtphub.conf: + + gtphub + bind-to-sgsns 127.0.0.3 + bind-to-ggsns 127.0.0.4 + ggsn-proxy 127.0.0.2 + end + + +( +You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX +address and GGSN IP address to /etc/hosts something like: + + 127.0.0.2 internet.mnc070.mcc901.gprs + +) + + +Once the config files are in place, start the programs, in separate terminals. +GGSN and SGSN need to be started with root priviliges to be able to create tun +interfaces. GTPHub may run as unprivileged user. + +The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. + + +1. GGSN: + + sudo -s + cd <your-test-dir> + LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf + +2. GTPHub: + + cd <your-test-dir> + path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level + +3. SGSN tests: + + sudo -s + cd <your-test-dir> + /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --imsi 420001214365100 --contexts=3 + +Add more SGSNs using different IMSIs and local ports (if the same IMSI is used, +the GGSN will reuse TEIs and tunnels will be discarded automatically): + + /usr/local/bin/sgsnemu --createif -l 127.0.0.11 -r 127.0.0.3 --imsi 420001214365300 --contexts=3 + +This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu +still needs some effort to announce a mobile subscriber or the like (I have +used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). + +The core capability of GTPHub is to manage more than two GSNs, e.g. an SGSN +contacting various GGSNs over the single GTPHub link. You would configure the +SGSN to use one fixed GGSN (sending to gtphub) and gtphub will resolve the +GGSNs once it has received the messages. So the SGSN may be behind NAT (add +"sgsn-use-sender" to gtphub.conf) and communicate to various GGSNs over a +single link to gtphub. + +I hope this helps to get you going. +Any suggestions/patches are welcome! + +~Neels + diff --git a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg new file mode 100644 index 000000000..3913d2c3c --- /dev/null +++ b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg @@ -0,0 +1,25 @@ +! +! Osmocom gtphub configuration +! +! This file is used for VTY tests, referenced by openbsc/osmoappdesc.py +! For the test, try to use most config commands. +! + +line vty + no login + +gtphub + ! Local addresses to listen on and send from, both on one interface. + ! The side towards SGSN uses nonstandard ports. + bind-to-sgsns ctrl 127.0.0.1 12123 user 127.0.0.1 12153 + ! The GGSN side with standard ports. + bind-to-ggsns 127.0.0.1 + + ! Proxy: unconditionally direct all traffic to... + sgsn-proxy 127.0.0.4 + + ! Proxy with nonstandard ports or separate IPs: + ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 + + ! Add a name server for GGSN resolution + grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg new file mode 100644 index 000000000..0dc415047 --- /dev/null +++ b/doc/examples/osmo-gtphub/osmo-gtphub.cfg @@ -0,0 +1,25 @@ +! +! Osmocom gtphub configuration +! + +line vty + no login + +gtphub + ! Local addresses to listen on and send from, each on standard ports + ! 2123 and 2152. Setting these addresses is mandatory. + bind-to-sgsns 127.0.0.1 + bind-to-ggsns 127.0.0.2 + + ! Local nonstandard ports or separate IPs: + !bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223 + + ! Proxy: unconditionally direct all traffic to... + !ggsn-proxy 127.0.0.3 + !sgsn-proxy 127.0.0.4 + + ! Proxy with nonstandard ports or separate IPs: + !ggsn-proxy ctrl 127.0.0.3 2123 user 127.0.0.5 2152 + + ! Add a name server for GGSN resolution + !grx-dns-add 192.168.0.1 diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg new file mode 100644 index 000000000..b47878a21 --- /dev/null +++ b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg @@ -0,0 +1,28 @@ +! +! Osmocom SGSN configuration +! +! +line vty + no login +! +sgsn + gtp local-ip 127.0.0.1 + ggsn 0 remote-ip 127.0.0.2 + ggsn 0 gtp-version 1 + ggsn 0 echo-interval 60 + auth-policy accept-all +! +ns + timer tns-block 3 + timer tns-block-retries 3 + timer tns-reset 3 + timer tns-reset-retries 3 + timer tns-test 30 + timer tns-alive 3 + timer tns-alive-retries 10 + encapsulation udp local-ip 127.0.0.1 + encapsulation udp local-port 23000 + encapsulation framerelay-gre enabled 0 +! +bssgp +! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg new file mode 100644 index 000000000..263bd00e2 --- /dev/null +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -0,0 +1,30 @@ +! +! Osmocom SGSN configuration +! +! +line vty + no login +! +sgsn + gtp local-ip 127.0.0.1 + ggsn 0 remote-ip 127.0.0.2 + ggsn 0 gtp-version 1 + ggsn 0 echo-interval 60 + auth-policy remote + gsup remote-ip 127.0.0.1 + gsup remote-port 4222 +! +ns + timer tns-block 3 + timer tns-block-retries 3 + timer tns-reset 3 + timer tns-reset-retries 3 + timer tns-test 30 + timer tns-alive 3 + timer tns-alive-retries 10 + encapsulation udp local-ip 127.0.0.1 + encapsulation udp local-port 23000 + encapsulation framerelay-gre enabled 0 +! +bssgp +! |