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
|
|
|
|
-------------
|
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
.. 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
|
2020-03-21 10:55:58 +08:00
|
|
|
CONFIG_SIM_NETDEV_VPNKIT_PATH="/tmp/vpnkit-nuttx"
|
2020-03-19 20:17:01 +08:00
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
You can use the ``sim:vpnkit`` configuration, which includes the above
|
2020-03-19 20:32:55 +08:00
|
|
|
settings.
|
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-03-19 20:32:55 +08:00
|
|
|
./tools/configure.sh sim:vpnkit
|
|
|
|
|
2020-03-19 20:30:12 +08:00
|
|
|
VPNKit setup
|
|
|
|
------------
|
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
See `https://github.com/moby/vpnkit` for build instructions.
|
2020-03-19 20:30:12 +08:00
|
|
|
|
2020-03-20 14:15:45 +08:00
|
|
|
If you have Docker Desktop for Mac installed on your machine,
|
2020-03-19 20:30:12 +08:00
|
|
|
you can find a vpnkit binary at:
|
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-03-19 20:30:12 +08:00
|
|
|
/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:
|
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
`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:
|
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-03-19 20:17:01 +08:00
|
|
|
% vpnkit --ethernet /tmp/vpnkit-nuttx &
|
|
|
|
% ./nuttx
|
|
|
|
|
2024-09-12 22:56:03 +08:00
|
|
|
NuttX's ``CONFIG_SIM_NETDEV_VPNKIT_PATH`` should match vpnkit's
|
|
|
|
``--ethernet`` option.
|