Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abousselmi/gtp-gw
A dead simple GTP Gatway based on osmocom's libgtpnl
https://github.com/abousselmi/gtp-gw
Last synced: 19 days ago
JSON representation
A dead simple GTP Gatway based on osmocom's libgtpnl
- Host: GitHub
- URL: https://github.com/abousselmi/gtp-gw
- Owner: abousselmi
- License: lgpl-2.1
- Created: 2020-10-20T17:26:22.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T23:14:05.000Z (8 months ago)
- Last Synced: 2024-05-18T18:47:29.856Z (8 months ago)
- Language: Shell
- Homepage:
- Size: 25.4 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple GTP Gateway example
This example make use of libgtpnl from osmocom to create a GTP tunnel
and send some traffic.## Install dependencies
```console
apt-get update && apt-get install -y autoconf libtool pkg-config
```## Setup
First, get the example:
```console
git clone https://github.com/abousselmi/gtp-gw.git
cd gtp-gw
```Second, you need to clone libgtpnl and compile it:
```console
git clone https://git.osmocom.org/libgtpnl
cd libgtpnl
autoreconf -fi
./configure && make
sudo make install
sudo ldconfig
```Now we need to copy the example script where we have the gtp wrappers:
```console
cp ../gtpgw.sh ./tools
cd tools
```Now you can run the example and enjoy:
```console
./gtpgw.sh start
```To destroy everything, you can do:
```console
./gtpgw.sh stop
```## Sample output
```console
./gtpgw.sh start
[INFO] create veth pairs
[INFO] create network namespaces
[INFO] attribute each veth pair to its correspondent netns
[INFO] set ip addresses of veth pairs and loopbacks
[INFO] enable veth and lo interfaces
[INFO] create gtp devices (run in bg mode)
[INFO] configure mtu of gtp devices
WARNING: attaching dummy socket descriptors. Keep this process running for testing purposes.
WARNING: attaching dummy socket descriptors. Keep this process running for testing purposes.
[INFO] create gtp tunnels
[INFO] version 1 tei 200/100 ms_addr 192.168.0.200 sgsn_addr 172.100.0.200
[INFO] version 1 tei 100/200 ms_addr 192.168.0.100 sgsn_addr 172.100.0.100
[INFO] configure routes using gtp devicesYou can go for e.g.:
ip netns exec ns-gtp-100 ping 192.168.0.200
ip netns exec ns-gtp-200 ping 192.168.0.100Using tshark you will see ICMP pckets encapsulated in GTP
```## Credits
- [Kentaro Ebisawa libgtpnl (gtpc) tutorial](https://www.slideshare.net/kentaroebisawa/using-gtp-on-linux-with-libgtpnl)
- [osmocom gtpu](https://osmocom.org/projects/linux-kernel-gtp-u/wiki)
- [osmocom gtpc](https://osmocom.org/projects/linux-kernel-gtp-u/wiki/Libgtpnl)