Update port-forward.sh
This commit is contained in:
parent
7023e2a5e9
commit
e72a84d95d
@ -38,9 +38,6 @@ ip=${ip%.*}
|
||||
# portPerHost + 1
|
||||
portPerHost=$((portPerHost + 1))
|
||||
|
||||
# 启用IP转发
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
|
||||
# 清除旧的iptables规则
|
||||
iptables -t nat -F
|
||||
iptables -t nat -X
|
||||
@ -54,6 +51,9 @@ iptables -P INPUT ACCEPT
|
||||
iptables -P FORWARD ACCEPT
|
||||
iptables -P OUTPUT ACCEPT
|
||||
|
||||
# 启用IP转发
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
|
||||
# 计算每个主机号的端口范围
|
||||
function calculatePortRanges() {
|
||||
hostNumber=$1
|
||||
|
Loading…
Reference in New Issue
Block a user