mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-11-11 18:00:35 +08:00
Update
This commit is contained in:
parent
00b1390ba0
commit
e7aa515235
2 changed files with 15 additions and 10 deletions
|
|
@ -116,6 +116,18 @@ iface vmbr0 inet static
|
||||||
bridge_stp off
|
bridge_stp off
|
||||||
bridge_fd 0
|
bridge_fd 0
|
||||||
EOF
|
EOF
|
||||||
|
elif [ -f "/root/iface_auto.txt" ]; then
|
||||||
|
cat << EOF | sudo tee -a "$interfaces_file"
|
||||||
|
auto vmbr0
|
||||||
|
iface vmbr0 inet static
|
||||||
|
address $ipv4_address
|
||||||
|
gateway $gateway
|
||||||
|
bridge_ports $interface
|
||||||
|
bridge_stp off
|
||||||
|
bridge_fd 0
|
||||||
|
|
||||||
|
iface eth0 inet6 auto
|
||||||
|
EOF
|
||||||
else
|
else
|
||||||
cat << EOF | sudo tee -a "$interfaces_file"
|
cat << EOF | sudo tee -a "$interfaces_file"
|
||||||
auto vmbr0
|
auto vmbr0
|
||||||
|
|
@ -162,7 +174,7 @@ if grep -q "^net.ipv4.ip_forward=1" /etc/sysctl.conf; then
|
||||||
sed -i 's/^#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
|
sed -i 's/^#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
|
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
|
||||||
fi
|
fi
|
||||||
${sysctl_path} -p
|
${sysctl_path} -p
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# from
|
# from
|
||||||
# https://github.com/spiritLHLS/pve
|
# https://github.com/spiritLHLS/pve
|
||||||
# 2023.06.25
|
# 2023.06.26
|
||||||
|
|
||||||
cd /root >/dev/null 2>&1
|
cd /root >/dev/null 2>&1
|
||||||
_red() { echo -e "\033[31m\033[01m$@\033[0m"; }
|
_red() { echo -e "\033[31m\033[01m$@\033[0m"; }
|
||||||
|
|
@ -168,14 +168,7 @@ do
|
||||||
if [ -n "$matches" ]; then
|
if [ -n "$matches" ]; then
|
||||||
# SLAAC动态分配,做无IPV6的处理
|
# SLAAC动态分配,做无IPV6的处理
|
||||||
sed -i "/iface $interface inet6 auto/d" $1
|
sed -i "/iface $interface inet6 auto/d" $1
|
||||||
# cdn_urls=("https://cdn.spiritlhl.workers.dev/" "https://cdn3.spiritlhl.net/" "https://cdn1.spiritlhl.net/" "https://ghproxy.com/" "https://cdn2.spiritlhl.net/")
|
echo "$interface" > "/root/iface_auto.txt"
|
||||||
# check_cdn_file
|
|
||||||
# wget ${cdn_success_url}https://raw.githubusercontent.com/spiritLHLS/pve/main/extra_scripts/configure_network.sh -O /usr/local/bin/configure_network.sh
|
|
||||||
# wget ${cdn_success_url}https://raw.githubusercontent.com/spiritLHLS/pve/main/extra_scripts/configure_network.service -O /etc/systemd/system/configure_network.service
|
|
||||||
# chmod 777 /usr/local/bin/configure_network.sh
|
|
||||||
# chmod 777 /etc/systemd/system/configure_network.service
|
|
||||||
# systemctl daemon-reload
|
|
||||||
# systemctl enable configure_network.service
|
|
||||||
else
|
else
|
||||||
# 将 "auto" 替换为 "static"
|
# 将 "auto" 替换为 "static"
|
||||||
modified_line="${line/auto/static}"
|
modified_line="${line/auto/static}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue