Uses LWIP version 2 to enable networking for Sming running on a Windows or Linux Host system.


Network support is enabled by default. If you don’t need it, use the --nonet command-line option.

Build Variables

0 (default)
Standard build
Enable debugging output

2 (default)

Setting this to any other value will cause a build error.


Support is provided via TAP network interface (a virtual network layer operating at the ethernet frame level). A TAP interface must be created first, and requires root priviledge:

sudo ip tuntap add dev tap0 mode tap user `whoami`
sudo ip a a dev tap0
sudo ifconfig tap0 up

This creates the tap0 interface. The emulator will automatically select the first tap interface found. To override this, use the --ifname option. An IP address will be assigned, but can be changed using the --ipaddr option.

If your application needs to access the internet, additional setup is required:

sudo sysctl net.ipv4.ip_forward=1
sudo sysctl net.ipv6.conf.default.forwarding=1
sudo sysctl net.ipv6.conf.all.forwarding=1

export INTERNET_IF=wlan0 # <!--- Make sure to replace wlan0 with the network interface connected to Internet

sudo iptables -t nat -A POSTROUTING -o $INTERNET_IF -j MASQUERADE
sudo iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i tap0 -o $INTERNET_IF -j ACCEPT


Requires NPCAP library to be installed. Provided with current (3.0.2) version of Wireshark.

By default, the first valid network adapter will be used, with address assigned via DHCP.

If the adapter is wrong, get a list thus:

out\Host\Windows\debug\firmware\app --ifname=?


make run HOST_NETWORK_OPTIONS=--ifname=?

produces a listing:

Available adapters:
- 0: {ACC6BFB2-A15B-4CF8-B93A-8D97644D0AAC} - Oracle /
- 1: {A12D4DD0-0EA8-435D-985E-A1F96F781EF0} - NdisWan Adapter
- 2: {3D66A354-39DD-4C6A-B9C4-14EE223FC3D1} - MS NDIS 6.0 LoopBack Driver /
- 3: {BC53D919-339E-4D70-8573-9D7A8AE303C7} - NdisWan Adapter
- 4: {3CFD43EA-9CC7-44A7-83D4-EB04DD029FE7} - NdisWan Adapter
- 5: {530640FF-A9C3-436B-9EA2-65102C788119} - Realtek PCIe GBE Family Controller /
- 6: {0F649280-BAC2-4515-9CE3-F7DFBB6A1BF8} - Kaspersky Security Data Escort Adapter /

Then use the appropriate number (or GUID), with the gateway IP address - an address will be assigned via DHCP:

make run HOST_NETWORK_OPTIONS="--ifname=5 --gateway="

You can find gateway addresses using the ipconfig command.

If you want to use a specific IP address, the appropriate adapter will be selected but you still need to specify the gateway address:

make run HOST_NETWORK_OPTIONS="--ipaddr= --gateway="


Used by

Environment Variables