From ce2459e392134f69e197250cdecc18465579368b Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:56:29 +0800 Subject: [PATCH] Update build_nat_network.sh --- build_nat_network.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build_nat_network.sh b/build_nat_network.sh index 9970a09..19c8c6f 100644 --- a/build_nat_network.sh +++ b/build_nat_network.sh @@ -56,10 +56,7 @@ EOF fi # 加载iptables并设置回源且允许NAT端口转发 -if ! command -v iptables &> /dev/null; then - _green "iptables 未安装,正在安装..." - apt-get install -y iptables -fi +apt-get install -y iptables iptables-persistent iptables -t nat -A POSTROUTING -j MASQUERADE sysctl net.ipv4.ip_forward=1 sysctl_path=$(which sysctl)