进到
/etc/network/interfaces.d新建eth0-addrs.cfg
nano eth0-addrs.cfg写入对应IP
auto eth0:0
iface eth0:0 inet static
address 1.1.1.1/32
auto eth0:1
iface eth0:1 inet static
address 2.2.2.2/32
auto eth0:2
iface eth0:2 inet static
address 3.3.3.3/32
auto eth0:3
iface eth0:3 inet static
address 4.4.4.4/32重启网络
systemctl restart networking禁用IPV6
nano /etc/sysctl.conf# 禁用所有 IPv6
net.ipv6.conf.all.disable_ipv6 = 1
# 禁用特定接口(如 eth0)的 IPv6,如果 eth0 是你的主网卡
# net.ipv6.conf.eth0.disable_ipv6 = 1
# 禁用默认接口的 IPv6
net.ipv6.conf.default.disable_ipv6 = 1sysctl -p