物理机centos7.9扩展网卡

前段时间装了一台机器,系统是centos7.9,主板自带两个网口,不够用,又插了一块Inter芯片的4口pcie网卡,

重启系统后,使用ip a 查看ip信息,网卡直接识别到了,但/etc/sysconfig/network-scripts/目录里没有网卡配置文件,

需要手动创建这些文件:

#进入目录
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
#将现在的网卡复制一份,新文件名根据ip a 来定
[root@localhost network-scripts]# cp ifcfg-eth0 ifcfg-eth2
#四个网口,共需要建4个网卡配置文件
[root@localhost network-scripts]# cp ifcfg-eth0 ifcfg-eth3
[root@localhost network-scripts]# cp ifcfg-eth0 ifcfg-eth4
[root@localhost network-scripts]# cp ifcfg-eth0 ifcfg-eth5
#然后修改文件
[root@localhost network-scripts]# vim ifcfg-eth2
#主要修改下面几项,并注释掉UUID
BOOTPROTO=dhcp
NAME=eth2
#UUID=***-***-***-***-******
DEVICE=eth2
ONBOOT=no
#修改完成后保存,依次修改剩余的配置文件,修改完后重启网络
[root@localhost network-scripts]# service network restart

补充:

uuid可以使用uuidgen创建一个新的,写入配置文件中,4个网卡就生成4个新的uuid

posted @ 2024-05-11 11:47  xjournal  阅读(8)  评论(0编辑  收藏  举报