Centos7/8
修改网卡文件(网卡名eth0请以实际为准)
nano /etc/sysconfig/network-scripts/ifcfg-eth0
配置如下
192.168.1.11为出口IPV4
192.168.1.12为副IPV4
2409::2:0:11为出口IPV6
2409::2:0:12为副IPV6
# network-config TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes DEVICE=eth0 ONBOOT=yes IPADDR=192.168.1.11 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 IPADDR1=192.168.1.12 NETMASK1=255.255.255.0 IPV6INIT=yes IPV6_AUTOCONF=no IPV6ADDR=2409::2:0:11/96 IPV6_DEFAULTGW=2409::2:0:1 IPV6ADDR_SECONDARIES=2409::2:0:12/96 DNS1=119.29.29.29 DNS2=223.6.6.6
保存配置并生效
systemctl restart network
Debian9/10/11/12
修改网卡文件
nano /etc/network/interfaces
配置如下
192.168.1.11为出口IPV4
192.168.1.12为副IPV4
2409::2:0:11为出口IPV6
2409::2:0:12为副IPV6
# network-config auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.11 netmask 255.255.255.0 gateway 192.168.1.1 iface eth0 inet6 static address 2409::2:0:11 netmask 96 gateway 2409::2:0:1 auto eth0:1 iface eth0:1 inet static address 192.168.1.12 netmask 255.255.255.0 iface eth0:1 inet6 static address 2409::2:0:12 netmask 96
保存配置并生效
systemctl restart networking