时间:2021-05-19
centos 把网卡名称修改为 eth0
默认网卡名称是 eno16777736
1、修改配置文件 ifcfg-eno16777736
[root@localhost ~]# cd /etc/sysconfig/network-scripts/[root@localhost network-scripts]# vim ifcfg-eno16777736将 NAME 和 DEVICE 修改为 eth0
TYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noNAME=eth0UUID=0fea6de7-54d9-4a8d-bddc-3061678e8a0eDEVICE=eth0ONBOOT=yesPEERDNS=yesPEERROUTES=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yes重命名该文件
mv ifcfg-eno16777736 ifcfg-eth02、禁用该可预测命名规则
在 grup 文件里面的 GRUB_CMDLINE_LINUX 变量添加 net.ifnames=0 biosdevname=0
[root@localhost network-scripts]# vim /etc/default/grubGRUB_TIMEOUT=5GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"GRUB_DEFAULT=savedGRUB_DISABLE_SUBMENU=trueGRUB_TERMINAL_OUTPUT="console"GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0 rhgb quiet"GRUB_DISABLE_RECOVERY="true"运行命令重新生成GRUB配置并更新内核参数
[root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfgGenerating grub configuration file ...Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.imgFound linux image: /boot/vmlinuz-0-rescue-692c580a413f41d8b51ddc4724500560Found initrd image: /boot/initramfs-0-rescue-692c580a413f41d8b51ddc4724500560.imgdone3、重启系统
[root@localhost network-scripts]# reboot now查看网卡信息
[root@localhost network-scripts]# ifconfigeth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.81.128 netmask 255.255.255.0 broadcast 192.168.81.255 inet6 fe80::20c:29ff:fe5b:1a46 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:5b:1a:46 txqueuelen 1000 (Ethernet) RX packets 474 bytes 41909 (40.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 266 bytes 45987 (44.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 6 bytes 564 (564.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 564 (564.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 00:00:00:00:00:00 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
查看原来的网卡eth0:查看新添加的网卡eth1:复制ifcfg-eth0到ifcfg-eth1新文件viifcfg-eth0编辑,修改网卡名字为eth1;修改
问题:部分Dell服务器在安装Linux操作系统之后,发现网卡名称变成em1了。解决办法:修改网卡名称为eth0,这里以CentOS操作系统为例。一:修改系统g
虚拟化中,从模板克隆出来的虚拟机网卡都会被命名为eth1,而有些程序或者脚本,涉及到网卡的,默认写的是eth0,这时就存在要将eth1改为eth0的问题,方法如
本文介绍了Centos7更改网卡名称Eth0的方法,分享给大家,希望对大家有所帮助安装完Centos7系统,网卡命名跟之前发生了变化,例如!就是看着不爽也不会影
linux修改网卡网卡名称eno16777736改为eth01.vim/etc/sysconfig/grub然后,往这个文件中添加“net.ifnames=0b