aboutsummaryrefslogtreecommitdiff
path: root/debian-container/README
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-10-29 02:57:51 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-10-29 02:57:51 +0800
commitaeb1ab2c3e960c6eb38ee2c9b18519b9b3bd8fa4 (patch)
tree4404733e7bce7e41058ee227c8ce1c8fbf9d57a3 /debian-container/README
parentb25c21a3272416d52e805b5253cc46f59587d4c2 (diff)
downloadrutils-aeb1ab2c3e960c6eb38ee2c9b18519b9b3bd8fa4.tar.gz
rutils-aeb1ab2c3e960c6eb38ee2c9b18519b9b3bd8fa4.tar.xz
Add NAT networking with bridge, veth, DNS, routing, and firewall configuration for containers.
Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
Diffstat (limited to 'debian-container/README')
-rw-r--r--debian-container/README9
1 files changed, 8 insertions, 1 deletions
diff --git a/debian-container/README b/debian-container/README
index c0ef344..0328def 100644
--- a/debian-container/README
+++ b/debian-container/README
@@ -46,6 +46,7 @@ sudo ./debian-container.sh resize test-3 --size 12G
sudo ./debian-container.sh enter test-1
sudo ./debian-container.sh enter test-1 --network host
+sudo ./debian-container.sh enter test-1 --network nat
sudo ./debian-container.sh enter test-1 --mount /home/richard/project:/workspace:rw
sudo ./debian-container.sh enter test-1 --mount /home/richard/data:/data:ro
@@ -53,6 +54,7 @@ sudo ./debian-container.sh enter test-1 --mount /home/richard/data:/data:ro
sudo ./debian-container.sh exec test-1 -- uname -a
sudo ./debian-container.sh exec test-1 --network host -- apt-get update
+sudo ./debian-container.sh exec test-1 --network nat -- apt-get update
sudo ./debian-container.sh exec test-1 --mount /home/richard/project:/workspace:rw -- make -C /workspace
列出和查看容器:
@@ -95,7 +97,12 @@ DEBIAN_ARCH 目标架构
DEBIAN_MIRROR Debian 镜像地址
DEBIAN_INCLUDE 额外软件包,使用逗号分隔
DEBIAN_EXCLUDE 要排除的软件包,使用逗号分隔
-DEBIAN_NETWORK 默认网络模式,none 或 host
+DEBIAN_NETWORK 默认网络模式,none、host 或 nat
+DEBIAN_NAT_BRIDGE NAT 网桥名称,默认 rutils0
+DEBIAN_NAT_NETWORK NAT 子网,默认 10.88.0.0/24
+DEBIAN_NAT_GATEWAY NAT 网关地址,默认 10.88.0.1
+DEBIAN_NAT_ADDRESS NAT 容器地址,默认 10.88.0.2
+DEBIAN_NAT_DNS NAT 模式 DNS,默认 1.1.1.1
挂载参数格式: