这篇文章主要讲解了“linux配置IP地址重启网络报错RTNETLINK answers: File exists怎么办”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“linux配置IP地址重启网络报错RTNETLINK answers: File exists怎么办”吧!
安装操作系统时,没有设置IP,安装完成后,设置IP时重启网络报错:
#service network restart
RTNETLINK answers: File exists
检查发现起了 NetworkManager:
#chkconfig --list|grep -i manager
NetworkManager 0:off 1:ff 2:on 3:on 4:on 5:on 6:off
关闭NetworkManager即可:
#chkconfig NetworkManager off
#service NetworkManager stop
#service network restart
但是重启网络后发现没有IP地址:
# ip ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:07:e5:89 brd ff:ff:ff:ff:ff:ff
inet6 fe80::20c:29ff:fe07:e589/64 scope link
valid_lft forever preferred_lft forever
检查发现是因为下面的IPADDR 和 NETMASK手工配置时写成了小写,无法识别到
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
ipaddr=192.168.1.11
netmask=255.255.255.0
改成大小就好了:
IPADDR=192.168.1.11
NETMASK=255.255.255.0
重启网络,识别到IP地址:
#service network restart
# ip ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:07:e5:89 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.11/24 brd 192.168.1.255 scope global eth0
inet6 fe80::20c:29ff:fe07:e589/64 scope link
valid_lft forever preferred_lft forever
感谢各位的阅读,以上就是“linux配置IP地址重启网络报错RTNETLINK answers: File exists怎么办”的内容了,经过本文的学习后,相信大家对linux配置IP地址重启网络报错RTNETLINK answers: File exists怎么办这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。