若添加单个IP
cd /etc/sysconfig/network-scripts/
vi ifcfg-eth0:0
DEVICE="eth0:0"
ONBOOT=yes
BOOTPROTO=static
IPADDR="你的IP"
NETMASK="255.255.255.255"
BROADCAST="你的IP"
如果还有其他IP
vi ifcfg-eth0:1
设置完成后重启网络
service network restart
centos8/rocky Linux8的网卡重启命令:
nmcli connection reload
查看网卡绑定情况
ip addr show eth0