From cbf797e87f9713bf6dd7dc54cedd32dc7f5654d2 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:11:06 +0000 Subject: [PATCH] 2023.10.03 --- CHANGELOG.md | 6 ++++++ README.md | 6 ++---- scripts/buildvm.sh | 6 +++--- scripts/buildvm_extraip.sh | 12 ++++++++---- scripts/buildvm_manual_ip.sh | 6 +++--- scripts/buildvm_onlyv6.sh | 6 +++--- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8c9de2..d092ae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # 更新日志 +2023.09.16 + +- 修复DNS修补过程中可能存在的判断漏洞 +- 修复可能存在的ndp的sysctl设置问题 +- 修复可能存在的网关的路由缓存问题,增加自动修复的守护进程 + 2023.09.15 - 迁移了KVM镜像中Centos8-Stream的所在地址 diff --git a/README.md b/README.md index b54292b..29ee965 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,9 @@ ## 更新 -2023.09.16 +2023.10.03 -- 修复DNS修补过程中可能存在的判断漏洞 -- 修复可能存在的ndp的sysctl设置问题 -- 修复可能存在的网关的路由缓存问题,增加自动修复的守护进程 +- 修复开设带IPV6地址的虚拟机时,网关顺序错配的问题 [更新日志](CHANGELOG.md) diff --git a/scripts/buildvm.sh b/scripts/buildvm.sh index 9b5f348..cd7f703 100644 --- a/scripts/buildvm.sh +++ b/scripts/buildvm.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.08.23 +# 2023.10.03 # ./buildvm.sh VMID 用户名 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘 独立IPV6 # ./buildvm.sh 102 test1 1234567 1 512 5 40001 40002 40003 50000 50025 debian11 local N @@ -279,8 +279,8 @@ if [ "$independent_ipv6" == "y" ]; then if [ "$ipv6_prefixlen" -le 64 ]; then if [ ! -z "$ipv6_address" ] && [ ! -z "$ipv6_prefixlen" ] && [ ! -z "$ipv6_gateway" ] && [ ! -z "$ipv6_address_without_last_segment" ]; then if grep -q "vmbr2" /etc/network/interfaces; then - qm set $vm_num --ipconfig0 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" - qm set $vm_num --ipconfig1 ip=${user_ip}/24,gw=172.16.1.1 + qm set $vm_num --ipconfig0 ip=${user_ip}/24,gw=172.16.1.1 + qm set $vm_num --ipconfig1 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888 qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844 independent_ipv6_status="Y" diff --git a/scripts/buildvm_extraip.sh b/scripts/buildvm_extraip.sh index 349b890..6b59e74 100644 --- a/scripts/buildvm_extraip.sh +++ b/scripts/buildvm_extraip.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.08.23 +# 2023.10.03 # 自动选择要绑定的IPV4地址 # ./buildvm_extraip.sh VMID 用户名 密码 CPU核数 内存 硬盘 系统 存储盘 是否附加IPV6(默认为N) # ./buildvm_extraip.sh 152 test1 1234567 1 512 5 debian11 local N @@ -297,7 +297,11 @@ fi _green "The current IP to which the VM will be bound is: ${user_ip}" _green "当前虚拟机将绑定的IP为:${user_ip}" -qm create $vm_num --agent 1 --scsihw virtio-scsi-single --serial0 socket --cores $core --sockets 1 --cpu host --net0 virtio,bridge=vmbr0,firewall=0 +if [ "$independent_ipv6" == "n" ]; then + qm create $vm_num --agent 1 --scsihw virtio-scsi-single --serial0 socket --cores $core --sockets 1 --cpu host --net0 virtio,bridge=vmbr0,firewall=0 +else + qm create $vm_num --agent 1 --scsihw virtio-scsi-single --serial0 socket --cores $core --sockets 1 --cpu host --net0 virtio,bridge=vmbr0,firewall=0 --net1 virtio,bridge=vmbr2,firewall=0 +fi if [ "$system_arch" = "x86" ]; then qm importdisk $vm_num /root/qcow/${system}.qcow2 ${storage} else @@ -320,8 +324,8 @@ if [ "$independent_ipv6" == "y" ]; then if [ "$ipv6_prefixlen" -le 64 ]; then if [ ! -z "$ipv6_address" ] && [ ! -z "$ipv6_prefixlen" ] && [ ! -z "$ipv6_gateway" ] && [ ! -z "$ipv6_address_without_last_segment" ]; then if grep -q "vmbr2" /etc/network/interfaces; then - qm set $vm_num --ipconfig0 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" - qm set $vm_num --ipconfig1 ip=${user_ip}/${user_ip_range},gw=${gateway} + qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway} + qm set $vm_num --ipconfig1 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888 qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844 independent_ipv6_status="Y" diff --git a/scripts/buildvm_manual_ip.sh b/scripts/buildvm_manual_ip.sh index fda6416..d2e3456 100644 --- a/scripts/buildvm_manual_ip.sh +++ b/scripts/buildvm_manual_ip.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.08.23 +# 2023.10.03 # 手动指定要绑定的IPV4地址 # ./buildvm_manual_ip.sh VMID 用户名 密码 CPU核数 内存 硬盘 系统 存储盘 IPV4地址 是否附加IPV6(默认为N) @@ -327,8 +327,8 @@ if [ "$independent_ipv6" == "y" ]; then if [ "$ipv6_prefixlen" -le 64 ]; then if [ ! -z "$ipv6_address" ] && [ ! -z "$ipv6_prefixlen" ] && [ ! -z "$ipv6_gateway" ] && [ ! -z "$ipv6_address_without_last_segment" ]; then if grep -q "vmbr2" /etc/network/interfaces; then - qm set $vm_num --ipconfig0 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" - qm set $vm_num --ipconfig1 ip=${user_ip}/${user_ip_range},gw=${gateway} + qm set $vm_num --ipconfig0 ip=${user_ip}/${user_ip_range},gw=${gateway} + qm set $vm_num --ipconfig1 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888 qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844 independent_ipv6_status="Y" diff --git a/scripts/buildvm_onlyv6.sh b/scripts/buildvm_onlyv6.sh index f812e51..614b8b6 100644 --- a/scripts/buildvm_onlyv6.sh +++ b/scripts/buildvm_onlyv6.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.08.23 +# 2023.10.03 # 自动选择要绑定的IPV6地址 # ./buildvm_onlyv6.sh VMID 用户名 密码 CPU核数 内存 硬盘 系统 存储盘 # ./buildvm_onlyv6.sh 152 test1 1234567 1 512 5 debian11 local @@ -246,8 +246,8 @@ qm set $vm_num --ide2 ${storage}:cloudinit qm set $vm_num --nameserver 8.8.8.8,2001:4860:4860::8888 qm set $vm_num --searchdomain 8.8.4.4,2001:4860:4860::8844 user_ip="172.16.1.${num}" -qm set $vm_num --ipconfig0 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" -qm set $vm_num --ipconfig1 ip=${user_ip}/24,gw=172.16.1.1 +qm set $vm_num --ipconfig0 ip=${user_ip}/24,gw=172.16.1.1 +qm set $vm_num --ipconfig1 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}1" qm set $vm_num --cipassword $password --ciuser $user sleep 5 qm resize $vm_num scsi0 ${disk}G