以Debian为例
网卡文件在/etc/network/interfaces.d

编辑这个文件,IPV4的话添加以下内容
auto eth0:1
iface eth0:1 inet static
address IP/32
gateway 网关IP

如果要添加IPV6,也是在这个文件添加以下内容
auto eth1
iface eth1 inet6 static
address IPV6/112
gateway 网关IPV6

auto eth0:1
iface eth0:1 inet static
address IP/32
gateway 网关IP

auto eth1
iface eth1 inet6 static
address IPV6/112
gateway 网关IPV6