Skip to content

abousselmi/gtp-gw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Simple GTP Gateway example

This example make use of libgtpnl from osmocom to create a GTP tunnel and send some traffic.

Setup

First, get the example:

git clone https://github.com/abousselmi/gtp-gw.git
cd gtp-gw

Second, you need to clone libgtpnl and compile it:

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:

cp ../example.sh ./tools
cd tools

Now you can run the example and enjoy:

./example.sh start

To destroy everything, you can do:

./example.sh stop

Sample output

./example.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 devices

You 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.100

Using tshark you will see ICMP pckets encapsulated in GTP

Credits

License

MIT

About

An example to test libgtpnl lib of osmocom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages