From cf5626358089a12d8c4398bcc2053e2871985b79 Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:34:28 +0800 Subject: [PATCH] Update build_nat_network.sh --- build_nat_network.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_nat_network.sh b/build_nat_network.sh index 26c45df..30fbebf 100644 --- a/build_nat_network.sh +++ b/build_nat_network.sh @@ -55,12 +55,13 @@ iface vmbr1 inet static EOF fi -# 加载iptables并设置回源 +# 加载iptables并设置回源且允许NAT端口转发 if ! command -v iptables &> /dev/null; then green "iptables 未安装,正在安装..." apt-get install -y iptables fi iptables -t nat -A POSTROUTING -j MASQUERADE +sysctl net.ipv4.ip_forward=1 # 重启配置 service networking restart