[[email protected] ~]# cd /etc/sysconfig/network-scripts/
[[email protected] network-scripts]# cp ifcfg-eth0 ifcfg-eth0:1
[[email protected] network-scripts]# vim ifcfg-eth0:1
DEVICE=eth0:1
HWADDR=00:0C:29:73:E6:0D
TYPE=Ethernet
UUID=98b5dc88-94c0-4a78-a3e7-ba3873a4116d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.1.29
NETMASK=255.255.255.0
GATEWAY=192.168.1.2
DNS1=202.106.0.20
DNS2=8.8.8.8
保存退出
[[email protected] network-scripts]# service network restart 重启网卡服务
linux下一个网卡绑定多个ip
时间: 2024-12-14 07:47:58