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