Using Internet in the NuttX running on simulator

When using NuttX with TCP/IP support in the simulator you will not get network to the Internet. No ping to google, etc.

Fortunately it is easy to fix:

$ sudo sysctl -w net.ipv4.ip_forward=1

or

$ sudo ./tools/simhostroute.sh

Then everything works as expected:

nsh> ping 8.8.8.8
PING 8.8.8.8 56 bytes of data
56 bytes from 8.8.8.8: icmp_seq=0 time=40 ms
56 bytes from 8.8.8.8: icmp_seq=1 time=40 ms
56 bytes from 8.8.8.8: icmp_seq=2 time=40 ms
nsh> ping google.com
PING 142.250.218.174 56 bytes of data
56 bytes from 142.250.218.174: icmp_seq=0 time=40 ms
56 bytes from 142.250.218.174: icmp_seq=1 time=40 ms
56 bytes from 142.250.218.174: icmp_seq=2 time=40 ms

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s