Hi, osmocom team members
We have run OsmoGGSN project using the attached config file in this email and the following command:
osmo-ggsn
As you can see in the config file, we have set IP 127.0.0.2 for GGSN. After executing the above command, a tunnel named tun4 is created.
To communicate with SGSN, we use the SGSN emulator in OsmoGGSN as follow:
sgsnemu -l 127.0.0.1 -r 127.0.0.2
After executing the above command, we see that 2 packets are sent from SGSN to GGSN. These packets are "Echo request" and "Create PDP context request" and GGSN responses to SGSN with the packets "Echo response" and "Create PDP context response".
To test tun4, we send a GTP <DNS> packet containing an arbitrary query to GGSN and we see that this GTP <DNS> packet is received in Loopback (lo) interface and also, the DNS packet is received in tun4 interface. But there is no DNS response to our query neither in tun4 interface nor lo interface. A screenshot of the lo interface and tun4 interface in the wireshark is attached in this email (right is lo and left is tun4).
How can we receive DNS responses to our DNS query? (Does tun4 require routing or something else?)
Hi,
you are probably facing a routing issue, and you need to solve it by using different network namespaces (netns). In your current setup, you probably have routing for those DNS packets to go through the sgsnemu iface, and once the ggsn puts them again in the network stack after going through GTP, the kernel probably ends up dropping the packet because it finds out some sort of loop.
In order to solve it, the easiest is to run sgsnemu under a different netns, and set default routing inside that netns to the tun iface created by sgsnemu. AFAIR, the netns can take care of creating the netns and configuring it for you, check it's man page ("--defaultroute", "--netns").
Hope this is useful to you, Pau
Thanks Pau, I'll check it out and share my results with you.
On Mon, Feb 8, 2021 at 1:05 PM Pau Espin Pedrol pespin@sysmocom.de wrote:
Hi,
you are probably facing a routing issue, and you need to solve it by using different network namespaces (netns). In your current setup, you probably have routing for those DNS packets to go through the sgsnemu iface, and once the ggsn puts them again in the network stack after going through GTP, the kernel probably ends up dropping the packet because it finds out some sort of loop.
In order to solve it, the easiest is to run sgsnemu under a different netns, and set default routing inside that netns to the tun iface created by sgsnemu. AFAIR, the netns can take care of creating the netns and configuring it for you, check it's man page ("--defaultroute", "--netns").
Hope this is useful to you, Pau
--
- Pau Espin Pedrol pespin@sysmocom.de http://www.sysmocom.de/
=======================================================================
- sysmocom - systems for mobile communications GmbH
- Alt-Moabit 93
- 10559 Berlin, Germany
- Sitz / Registered office: Berlin, HRB 134158 B
- Geschaeftsfuehrer / Managing Director: Harald Welte
osmocom-net-gprs@lists.osmocom.org