mirror of
https://github.com/thelittlerocket/pve.git
synced 2024-11-15 19:44:38 +08:00
Update build_nat_network.sh
This commit is contained in:
parent
566ad780bc
commit
cf56263580
1 changed files with 2 additions and 1 deletions
|
@ -55,12 +55,13 @@ iface vmbr1 inet static
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 加载iptables并设置回源
|
# 加载iptables并设置回源且允许NAT端口转发
|
||||||
if ! command -v iptables &> /dev/null; then
|
if ! command -v iptables &> /dev/null; then
|
||||||
green "iptables 未安装,正在安装..."
|
green "iptables 未安装,正在安装..."
|
||||||
apt-get install -y iptables
|
apt-get install -y iptables
|
||||||
fi
|
fi
|
||||||
iptables -t nat -A POSTROUTING -j MASQUERADE
|
iptables -t nat -A POSTROUTING -j MASQUERADE
|
||||||
|
sysctl net.ipv4.ip_forward=1
|
||||||
|
|
||||||
# 重启配置
|
# 重启配置
|
||||||
service networking restart
|
service networking restart
|
||||||
|
|
Loading…
Reference in a new issue