> CentOS > CentOS故障 >

解决service network restart 报错

群里网友发来信息,说运行service network restart时报错,错误提示如下:
hutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
egrep: ifcfg-ifcfg-eth0: No such file or directory
Bringing up interface ifcfg-eth0:  ./ifup: configuration for ifcfg-eth0 not found.
Usage: ifup <device name>
                                                           [FAILED]

 

进入/etc/sysconfig/network-script/目录,运行 ls -al ,显示结果如下:

-rw-r--r--. 1 root root   229 Apr 22 17:06 ifcfg-eth0~
-rw-r--r--. 1 root root   211 Apr 23 09:24 ifcfg-eth0 
-rw-r--r--. 1 root root   166 Apr 22 16:36 ifcfg-eth0 ~
-rw-r--r--. 1 root root   254 Oct 10  2013 ifcfg-lo
lrwxrwxrwx. 1 root root    20 Apr 21 17:21 ifdown -> ../../../sbin/ifdown
-rwxr-xr-x. 1 root root   627 Oct 10  2013 ifdown-bnep
-rwxr-xr-x. 1 root root  5430 Oct 10  2013 ifdown-eth
-rwxr-xr-x. 1 root root   781 Oct 10  2013 ifdown-ippp
-rwxr-xr-x. 1 root root  4168 Oct 10  2013 ifdown-ipv6
lrwxrwxrwx. 1 root root    11 Apr 21 17:21 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root  1481 Oct 10  2013 ifdown-post
-rwxr-xr-x. 1 root root  1064 Oct 10  2013 ifdown-ppp
-rwxr-xr-x. 1 root root   835 Oct 10  2013 ifdown-routes
-rwxr-xr-x. 1 root root  1465 Oct 10  2013 ifdown-sit
-rwxr-xr-x. 1 root root  1434 Oct 10  2013 ifdown-tunnel
lrwxrwxrwx. 1 root root    18 Apr 21 17:21 ifup -> ../../../sbin/ifup
-rwxr-xr-x. 1 root root 12444 Oct 10  2013 ifup-aliases
-rwxr-xr-x. 1 root root   859 Oct 10  2013 ifup-bnep
-rwxr-xr-x. 1 root root 10556 Oct 10  2013 ifup-eth
-rwxr-xr-x. 1 root root 11971 Oct 10  2013 ifup-ippp
-rwxr-xr-x. 1 root root 10490 Oct 10  2013 ifup-ipv6
lrwxrwxrwx. 1 root root     9 Apr 21 17:21 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root   727 Oct 10  2013 ifup-plip
-rwxr-xr-x. 1 root root   954 Oct 10  2013 ifup-plusb
-rwxr-xr-x. 1 root root  2364 Oct 10  2013 ifup-post
-rwxr-xr-x. 1 root root  4154 Oct 10  2013 ifup-ppp
-rwxr-xr-x. 1 root root  1925 Oct 10  2013 ifup-routes
-rwxr-xr-x. 1 root root  3289 Oct 10  2013 ifup-sit
-rwxr-xr-x. 1 root root  2488 Oct 10  2013 ifup-tunnel
-rwxr-xr-x. 1 root root  3770 Oct 10  2013 ifup-wireless
-rwxr-xr-x. 1 root root  4623 Oct 10  2013 init.ipv6-global
-rwxr-xr-x. 1 root root  1125 Oct 10  2013 net.hotplug
-rw-r--r--. 1 root root 13386 Oct 10  2013 network-functions
-rw-r--r--. 1 root root 29853 Oct 10  2013 network-functions-ipv6

从上面可以看到,ifcfg-eth0多了2个文件,分别是ifcfg-eth0~  、 ifcfg-eth0 ~

删除这2个文件,但删除的过程中, ifcfg-eth0 ~ 提示无法删除,重启后再删除。

(责任编辑:IT)