换源,执行 cat /dev/null > /etc/apt/sources.list
后再自行加源
清华云:
cat > /etc/apt/sources.list <<EOF
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
EOF
获取pve源密钥并写入/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
wget http://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
——————————————————————————————————————————————————————————————————————————————————————————————————
更改PVE源并写入/etc/apt/sources.list.d/pve-install-repo.list
echo "deb http://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription" >/etc/apt/sources.list.d/pve-install-repo.list
——————————————————————————————————————————————————————————————————————————————————————————————————
更改环境变量
export LC_ALL=en_US.UTF-8
——————————————————————————————————————————————————————————————————————————————————————————————————
删除企业源
rm -rf /etc/apt/sources.list.d/pve-enterprise.list
删除订阅弹窗
nano /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
键入Ctrl+w 搜索 Ext.Msg.show
跳转到这一行,把将:Ext.Msg.show({
修改为:Ext.Msg.noshow({
bbr
cat >>/etc/sysctl.conf << EOF
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
EOF
生效
sysctl -p
更新
apt-get update
apt-get upgrade
编辑网卡配置文件:
nano /etc/network/interfaces
配置
auto vmbr0
iface vmbr0 inet static
address 137.XX.XX.XX/24
gateway 137.XX.XX.XX
bridge-ports eno1
bridge-stp off
bridge-fd 0
hwaddress 0C:C4:7A:93:86:26
iface vmbr0 inet6 static
address 2001:XXXX:XXXX:XXXX::1/64
auto vmbr1
iface vmbr1 inet static
address 192.168.0.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
iface vmbr1 inet6 static
post-up /sbin/ip -f inet6 route add 2001:XXXX:XXXX:XXff:ff:ff:ff:ff dev vmbr0
pre-down /sbin/ip -f inet6 route del 2001:XXXX:XXXX:XXff:ff:ff:ff:ff dev vmbr0
post-up /sbin/ip -f inet6 route add default via 2001:XXXX:XXXX:XXff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del default via 2001:XXXX:XXXX:XXff:ff:ff:ff:ff
post-up /sbin/ip -f inet6 neigh add proxy 2001:XXXX:XXXX:XXXX::/64 dev vmbr0
pre-down /sbin/ip -f inet6 neigh del proxy 2001:XXXX:XXXX:XXXX::/64 dev vmbr0
重启网络服务:
systemctl restart networking.service
然后安装ndppd:
apt -y install ndppd
编辑ndppd的配置文件:nano /etc/ndppd.conf
配置
proxy vmbr0 {
rule 2001:41d0:x:xxxx::/64 {
static
}
}
重启ndppd服务使其生效,并设置开机自启:
systemctl restart ndppd.service
systemctl enable ndppd.service
安装radvd:
apt -y install radvd
新建radvd配置文件:
nano /etc/radvd.conf
写入如下配置,ipv6地址块换成你自己的:
interface vmbr0 {
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
prefix 2001:41d0:x:xxxx::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
};
重启radvd服务使其生效,并设置开机自启
systemctl restart radvd.service
systemctl enable radvd.service
添加转发
nano /etc/sysctl.conf
添加以下
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.proxy_ndp = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.vmbr0.autoconf=0
net.ipv6.conf.vmbr0.accept_ra=2
生效
sysctl -p