This commit is contained in:
spiritlhl 2023-08-21 14:31:27 +00:00
parent af975b02c3
commit ade728313f
4 changed files with 4 additions and 6 deletions

View file

@ -245,9 +245,7 @@ pct set $CTID --hostname $CTID
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
echo "${ipv6_address_without_last_segment}${CTID}/${ipv6_prefixlen}"
echo "${ipv6_address_without_last_segment}2"
pct set $CTID --net0 name=eth0,ip6="${ipv6_address_without_last_segment}${CTID}/${ipv6_prefixlen}",bridge=vmbr2,gw6="${ipv6_address_without_last_segment}2"
pct set $CTID --net0 name=eth0,ip6="${ipv6_address_without_last_segment}${CTID}/128",bridge=vmbr2,gw6="${ipv6_address_without_last_segment}2"
pct set $CTID --net1 name=eth1,ip=${user_ip}/24,bridge=vmbr1,gw=172.16.1.1
pct set $CTID --nameserver 8.8.8.8,2001:4860:4860::8888 --nameserver 8.8.4.4,2001:4860:4860::8844
independent_ipv6_status="Y"

View file

@ -210,7 +210,7 @@ fi
pct start $CTID
pct set $CTID --hostname $CTID
user_ip="172.16.1.${num}"
pct set $CTID --net0 name=eth0,ip6=${ipv6_address_without_last_segment}${CTID}/${ipv6_prefixlen},bridge=vmbr2,gw6=${ipv6_address_without_last_segment}2/${ipv6_prefixlen}
pct set $CTID --net0 name=eth0,ip6="${ipv6_address_without_last_segment}${CTID}/128",bridge=vmbr2,gw6="${ipv6_address_without_last_segment}2"
pct set $CTID --net1 name=eth1,ip=${user_ip}/24,bridge=vmbr1,gw=172.16.1.1
pct set $CTID --nameserver 8.8.8.8,2001:4860:4860::8888 --nameserver 8.8.4.4,2001:4860:4860::8844
sleep 3

View file

@ -268,7 +268,7 @@ user_ip="172.16.1.${num}"
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
qm set $vm_num --ipconfig0 ip6=${ipv6_address_without_last_segment}${vm_num}/${ipv6_prefixlen},gw6=${ipv6_address_without_last_segment}2/${ipv6_prefixlen}
qm set $vm_num --ipconfig0 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}2"
qm set $vm_num --ipconfig1 ip=${user_ip}/24,gw=172.16.1.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

View file

@ -232,7 +232,7 @@ 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}/${ipv6_prefixlen},gw6=${ipv6_address_without_last_segment}2/${ipv6_prefixlen}
qm set $vm_num --ipconfig0 ip6="${ipv6_address_without_last_segment}${vm_num}/128",gw6="${ipv6_address_without_last_segment}2"
qm set $vm_num --ipconfig1 ip=${user_ip}/24,gw=172.16.1.1
qm set $vm_num --cipassword $password --ciuser $user
sleep 5