#LWM2M #Leshan #QEMU #Networking #networking #lwm2m #leshan #qemu

Thomas LE ROUX

Hi everybody !

I'm trying to build a projet using Zephyr & LWM2M (& Leshan).

For now, I’m prototyping on QEMU.

TL;DR before explaining more precisely my issue : There must be a way to connect a QEMU instance to a remote server, but I’m stuck trying to do this.

I have made my small application to test things out, and except Firmware Update (my previous mail), everything is working fine on a local scale.

Running my client & Leshan server on the server along with the loop-socat and loop-slip-tap scripts given on /tools/net-tools/ causes no issue.

(Procedure followed here : https://docs.zephyrproject.org/latest/guides/networking/qemu_setup.html).

I’d like to connect my client to a Leshan server running on an AWS EC2 Instance.

I have made a small schematic. The goal would be to connect my Client (aka QEMU) to the Leshan server running on the Instance.


From the QEMU instance, I am able to run small commands. One of them is « net ping xxx ». From my client, I am able to ping the local Leshan and my computer. The ping request direct to other peripherals (other computers, my Internet modem, remote Leshan …) all end up in a timeout.

From my computer, I am able to ping basically anyone on the network.

I have followed the tutorial (given here : https://docs.zephyrproject.org/latest/guides/networking/qemu_setup.html#setting-up-zephyr-and-nat-masquerading-on-host-to-access-internet), and added to my prj.conf : CONFIG_NET_CONFIG_MY_IPV4_GW="".

Running the following commands didn’t raise any error message, so I assume that eveything went right :

  • iptables -t nat -A POSTROUTING -j MASQUERADE -s

  • sysctl -w net.ipv4.ip_forward=1

I used Zenmap, a GUI tool for Nmap and here is my network’s map. Center point is my internet modem (choose this for a viewing perspective.) The long blue line going up is the route for reaching my EC2 instance. It confirms that my computer can reach anything, but only my computer can reach


I used Wireshark on the tap0 interface generated by loop-slip-tap.sh and it seems that the registration’s frame sent to the EC2 instance stays on the tap0 interface and never leaves my computer.

I think the issue might be related to the use of those 2 scripts but I’m not sure and I’m (clearly) not the best in terms of networking.

My problem is pretty much described, if needed, I can send some logs.

Thank you for your help !

Best regards,


Join devel@lists.zephyrproject.org to automatically receive all group messages.