slirp4netns/README.md
duyiwei 1a2e2c4dea
Specification NestOS Project Component Description File
Signed-off-by: duyiwei <duyiwei@kylinos.cn>
2023-06-21 06:42:04 +00:00

1.9 KiB
Raw Blame History

slirp4netns

介绍

slirp4netns provides user-mode networking ("slirp") for unprivileged network namespaces.

安装教程

Install slirp4netns rpm package:

yum install slirp4netns

使用说明

Terminal 1: Create user/network/mount namespaces

(host)$ unshare --user --map-root-user --net --mount
(namespace)$ echo $$ > /tmp/pid

In this documentation, we use (host)$ as the prompt of the host shell, (namespace)$ as the prompt of the shell running in the namespaces.

If unshare fails, try the following commands (known to be needed on Debian, Arch, and old CentOS 7.X):

(host)$ sudo sh -c 'echo "user.max_user_namespaces=28633" >> /etc/sysctl.d/userns.conf'
(host)$ [ -f /proc/sys/kernel/unprivileged_userns_clone ] && sudo sh -c 'echo "kernel.unprivileged_userns_clone=1" >> /etc/sysctl.d/userns.conf'
(host)$ sudo sysctl --system

Terminal 2: Start slirp4netns

(host)$ slirp4netns --configure --mtu=65520 --disable-host-loopback $(cat /tmp/pid) tap0
starting slirp, MTU=65520
...

参与贡献

master分支使用最新的上游版本如果检测到上游有最新版本发布先形成issue后再提交对应PR更新流程如下。

  1. 提交issue
  2. Fork 本仓库
  3. 新建 Feat_xxx 分支
  4. 提交代码
  5. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/