Neels Hofmeyr | c550faa | 2015-12-07 10:58:00 +0100 | [diff] [blame^] | 1 | Here is a simple setup to test GTPHub operations. The IP addresses picked will |
| 2 | work well only on a system that creates local addresses (127.0.0.123) on the |
| 3 | fly (like linux) -- you may pick of course different IP addresses. |
| 4 | |
| 5 | Overview of the example setup: |
| 6 | |
| 7 | sgsnemu gtphub ggsn |
| 8 | 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 |
| 9 | |
| 10 | Prerequisites: openggsn. |
| 11 | |
| 12 | Have a local directory where you store config files and from which you launch |
| 13 | the GSNs and the hub (they will store restart counter files in that dir). |
| 14 | In it, have these config files: |
| 15 | |
| 16 | ggsn.conf: |
| 17 | |
| 18 | # GGSN local address |
| 19 | listen 127.0.0.2 |
| 20 | |
| 21 | # End User Addresses are picked from this range |
| 22 | net 10.23.42.0/24 |
| 23 | |
| 24 | pcodns1 8.8.8.8 |
| 25 | |
| 26 | logfile /tmp/foo |
| 27 | |
| 28 | gtphub.conf: |
| 29 | |
| 30 | gtphub |
| 31 | bind-to-sgsns 127.0.0.3 |
| 32 | bind-to-ggsns 127.0.0.4 |
| 33 | ggsn-proxy 127.0.0.2 |
| 34 | end |
| 35 | |
| 36 | |
| 37 | ( |
| 38 | You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX |
| 39 | address and GGSN IP address to /etc/hosts something like: |
| 40 | |
| 41 | 127.0.0.2 internet.mnc070.mcc901.gprs |
| 42 | |
| 43 | ) |
| 44 | |
| 45 | |
| 46 | Once the config files are in place, start the programs, in separate terminals. |
| 47 | GGSN and SGSN need to be started with root priviliges to be able to create tun |
| 48 | interfaces. GTPHub may run as unprivileged user. |
| 49 | |
| 50 | The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. |
| 51 | |
| 52 | |
| 53 | 1. GGSN: |
| 54 | |
| 55 | sudo -s |
| 56 | cd <your-test-dir> |
| 57 | LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf |
| 58 | |
| 59 | 2. GTPHub: |
| 60 | |
| 61 | cd <your-test-dir> |
| 62 | path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level |
| 63 | |
| 64 | 3. SGSN test: |
| 65 | |
| 66 | sudo -s |
| 67 | cd <your-test-dir> |
| 68 | /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --contexts=3 |
| 69 | |
| 70 | This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu |
| 71 | still needs some effort to announce a mobile subscriber or the like (I have |
| 72 | used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). |
| 73 | |
| 74 | I hope this helps to get you going. |
| 75 | Any suggestions/patches are welcome! |
| 76 | |
| 77 | ~Neels |
| 78 | |