日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > centos >内容正文

centos

Centos7修改默认网卡名(改为eth0)以及网卡启动报错RTNETLINK answers: File exists处理...

發(fā)布時(shí)間:2025/5/22 centos 126 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Centos7修改默认网卡名(改为eth0)以及网卡启动报错RTNETLINK answers: File exists处理... 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

?

安裝好centos7版本的系統(tǒng)后,發(fā)現(xiàn)默認(rèn)的網(wǎng)卡名字有點(diǎn)怪,為了便于管理,可以手動(dòng)修改。下面對(duì)centos7版本下網(wǎng)卡重命名操作做一記錄:
1)編輯網(wǎng)卡信息
[root@linux-node2~]# cd /etc/sysconfig/network-scripts/ ? ? ? ? ? ? ? ? ? ? ? ? ? ? #進(jìn)入網(wǎng)卡目錄
[root@linux-node2network-scripts]# mv ifcfg-eno16777728 ifcfg-eth0 ? ? ? ? ?#將默認(rèn)的網(wǎng)卡名eno16777728改為eth0
[root@linux-node2network-scripts]# cat ifcfg-eth0 ? ? ? ? ? ? ? ? ? ? ? ?#編輯網(wǎng)卡信息
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
NAME=eth0? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #name修改為eth0
ONBOOT=yes
IPADDR=192.168.56.12
NETMASK=255.255.255.0
GATEWAY=192.168.56.2
DNS1=192.168.56.2

2)修改grub
[root@linux-node2~]# cat /etc/sysconfig/grub ? ? ? ? ? ? ? ? ?#編輯內(nèi)核信息,添加紅色字段的
GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=autorhgb net.ifnames=0 biosdevname=0 quiet"
GRUB_DISABLE_RECOVERY="true"

[root@linux-node2~]# grub2-mkconfig -o /boot/grub2/grub.cfg ? ? ? #生成啟動(dòng)菜單
Generatinggrub configuration file ...
Foundlinux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Foundinitrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Foundlinux image: /boot/vmlinuz-0-rescue-1100f7e6c97d4afaad2e396403ba7f61
Foundinitrd image: /boot/initramfs-0-rescue-1100f7e6c97d4afaad2e396403ba7f61.img
Done

也可以在開(kāi)機(jī)啟動(dòng)加載安裝系統(tǒng)界面設(shè)置。

3)驗(yàn)證是否修改成功

[root@linux-node2~]# reboot #必須重啟系統(tǒng)生效 [root@linux-node2~]# yum install net-tools #默認(rèn)centos7不支持ifconfig 需要看裝net-tools包 [root@linux-node2~]# ifconfig eth0 #在次查看網(wǎng)卡信息 eth0:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 192.168.56.12 netmask 255.255.255.0 broadcast 192.168.56.255inet6 fe80::20c:29ff:fe5c:7bb1 prefixlen 64 scopeid 0x20<link>ether 00:0c:29:5c:7b:b1 txqueuelen 1000 (Ethernet)RX packets 152 bytes 14503 (14.1 KiB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 98 bytes 14402 (14.0 KiB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0?

centos7啟動(dòng)網(wǎng)卡服務(wù)報(bào)錯(cuò)“RTNETLINK answers: File exists”的解決方法

[root@localhost network-scripts]# service NetworkManager stop Starting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.[root@localhost network-scripts]# systemctl status network.service ?.network.service - LSB: Bring up/down networkingLoaded: loaded (/etc/rc.d/init.d/network)Active: failed (Result: exit-code) since Mon 2017-03-20 18:41:03 CST; 3min 49s agoDocs: man:systemd-sysv-generator(8)Process: 18880 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)Mar 20 18:41:03 localhost.localdomain network[18880]: RTNETLINK answers: File exists Mar 20 18:41:03 localhost.localdomain network[18880]: RTNETLINK answers: File exists Mar 20 18:41:03 localhost.localdomain network[18880]: RTNETLINK answers: File exists Mar 20 18:41:03 localhost.localdomain network[18880]: RTNETLINK answers: File exists Mar 20 18:41:03 localhost.localdomain network[18880]: RTNETLINK answers: File exists Mar 20 18:41:03 localhost.localdomain network[18880]: RTNETLINK answers: File exists Mar 20 18:41:03 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1 Mar 20 18:41:03 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking. Mar 20 18:41:03 localhost.localdomain systemd[1]: Unit network.service entered failed state. Mar 20 18:41:03 localhost.localdomain systemd[1]: network.service failed.原因分析和解決: 在centos下出現(xiàn)該故障的原因是啟動(dòng)網(wǎng)絡(luò)的兩個(gè)服務(wù)/etc/init.d/network 和 /etc/init.d/NetworkManager有沖突。 從根本上說(shuō)是NetworkMaganager(NM)的帶來(lái)的沖突,停用NetworkManager即可解決。重啟即可。 [root@localhost network-scripts]# service NetworkManager stop Redirecting to /bin/systemctl stop NetworkManager.service [root@localhost network-scripts]# systemctl start network.service [root@localhost network-scripts]#

轉(zhuǎn)載于:https://www.cnblogs.com/kevingrace/p/5570274.html

總結(jié)

以上是生活随笔為你收集整理的Centos7修改默认网卡名(改为eth0)以及网卡启动报错RTNETLINK answers: File exists处理...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。