incubator-nuttx/Documentation/platforms/sim/network_vpnkit.rst

53 lines
1.1 KiB
ReStructuredText
Raw Normal View History

2020-03-19 20:17:01 +08:00
Network support with VPNKit
===========================
The simulation can be configured to use VPNKit to provide network support.
While this was developed for macOS, it should work on other platforms
as well.
Configuration
-------------
.. code-block:: bash
2020-03-19 20:17:01 +08:00
CONFIG_SIM_NETDEV=y
CONFIG_SIM_NETDEV_TAP is not set
CONFIG_SIM_NETDEV_VPNKIT=y
CONFIG_SIM_NETDEV_VPNKIT_PATH="/tmp/vpnkit-nuttx"
2020-03-19 20:17:01 +08:00
You can use the ``sim:vpnkit`` configuration, which includes the above
settings.
.. code-block:: bash
./tools/configure.sh sim:vpnkit
VPNKit setup
------------
See `https://github.com/moby/vpnkit` for build instructions.
2020-03-20 14:15:45 +08:00
If you have Docker Desktop for Mac installed on your machine,
you can find a vpnkit binary at:
.. code-block:: bash
/Applications/Docker.app/Contents/Resources/bin/com.docker.vpnkit
2020-03-25 09:06:09 +08:00
A docker image containing a static Linux binary is also available:
`https://hub.docker.com/r/djs55/vpnkit`
2020-03-25 09:06:09 +08:00
2020-03-19 20:17:01 +08:00
How to run
----------
You can use it as the following:
.. code-block:: bash
2020-03-19 20:17:01 +08:00
% vpnkit --ethernet /tmp/vpnkit-nuttx &
% ./nuttx
NuttX's ``CONFIG_SIM_NETDEV_VPNKIT_PATH`` should match vpnkit's
``--ethernet`` option.