diff --git a/README.md b/README.md index 2df43ba..d0ffbdf 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,14 @@ 待开发内容: -- iptables的映射存在重复的问题,待修复 - 支持创建带IPV6独立地址的但是是NAT的IPV4的VM虚拟机或CT容器 - KVM模板加载部分自定义的限制,避免机器用于滥用发包 ## 更新 -2023.08.15 +2023.08.19 -- 尝试增加Docker安装PVE的方法以适配宿主机不是Debian的情况,实测支持Ubuntu了,其他支持Docker的宿主机系统应该也没问题 +- iptables的映射存在重复的问题,已尝试修复 [更新日志](CHANGELOG.md) diff --git a/scripts/buildct.sh b/scripts/buildct.sh index 44a15a5..11d9a2d 100644 --- a/scripts/buildct.sh +++ b/scripts/buildct.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.08.04 +# 2023.08.19 # ./buildct.sh CTID 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘 @@ -270,6 +270,7 @@ iptables -t nat -A PREROUTING -p udp -m udp --dport ${port_first}:${port_last} - if [ ! -f "/etc/iptables/rules.v4" ]; then touch /etc/iptables/rules.v4 fi +iptables-save | awk '!seen[$0]++' | iptables-restore iptables-save > /etc/iptables/rules.v4 service netfilter-persistent restart diff --git a/scripts/buildvm.sh b/scripts/buildvm.sh index c768d9c..79eed91 100644 --- a/scripts/buildvm.sh +++ b/scripts/buildvm.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.08.04 +# 2023.08.19 # ./buildvm.sh VMID 用户名 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘 @@ -278,6 +278,7 @@ iptables -t nat -A PREROUTING -p udp -m udp --dport ${port_first}:${port_last} - if [ ! -f "/etc/iptables/rules.v4" ]; then touch /etc/iptables/rules.v4 fi +iptables-save | awk '!seen[$0]++' | iptables-restore iptables-save > /etc/iptables/rules.v4 service netfilter-persistent restart