From 1a2e2c4dea9df2b9e048ffd895ca929984586793 Mon Sep 17 00:00:00 2001 From: duyiwei Date: Wed, 21 Jun 2023 06:42:04 +0000 Subject: [PATCH] Specification NestOS Project Component Description File Signed-off-by: duyiwei --- README.md | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4f261c2..631de37 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,50 @@ # slirp4netns #### 介绍 -User-mode networking for unprivileged network namespaces. - -#### 软件架构 -软件架构说明 +slirp4netns provides user-mode networking ("slirp") for unprivileged network namespaces. #### 安装教程 -1. xxxx -2. xxxx -3. xxxx +Install slirp4netns rpm package: + +yum install slirp4netns #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +**Terminal 1**: Create user/network/mount namespaces + +```console +(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): + +```console +(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 + +```console +(host)$ slirp4netns --configure --mtu=65520 --disable-host-loopback $(cat /tmp/pid) tap0 +starting slirp, MTU=65520 +... +``` #### 参与贡献 -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +master分支使用最新的上游版本,如果检测到上游有最新版本发布,先形成issue后再提交对应PR更新,流程如下。 +1. 提交issue +2. Fork 本仓库 +3. 新建 Feat_xxx 分支 +4. 提交代码 +5. 新建 Pull Request #### 特技