2

I made a big mistake. Instead of typing :

rm -rf /etc/sysconfig/network-scripts/ifcfg-eth0

I typed:

rm -rf /etc/syconfig/network-scripts

Can anybody help me to repair this mistake?

Thanks in advance!

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
artaxerxe
  • 541
  • 2
  • 10
  • 22

2 Answers2

5
$ rpm -qf /etc/sysconfig/network-scripts/
initscripts-9.03.27-1.el6.centos.i686

So, get the initscripts RPM and re-install it.

Update:

You can get it from http://mirrors.kernel.org/centos/6.2/os/i386/Packages/initscripts-9.03.27-1.el6.centos.i686.rpm

Of course, you can get your network interface up and running without actually using the "ifup" script, or whatever. They're basically wrappers for "ip" or "dhclient" in any case. For example, if your eth0 interface is supposed to get its configuration dynamically, you should be able to run "dhclient eth0" directly. If it's static, you should be able to run "ip link set dev eth0 up ; sleep 10 ; ip addr add 192.168.1.100 brd 192.168.1.255 dev eth0" or something like that. Consult "man ip" for the actual options. (I'm old fashioned, and am more used to running ifconfig eth0 192.168.1.100 up or something similar).

cjc
  • 24,916
  • 3
  • 51
  • 70
  • yes, but I cannot connect to internet from the machine! – artaxerxe Feb 08 '12 at 14:11
  • 4
    Well, you're posting to the Internet right now, so can you do a sneakernet? You can get the RPM from http://mirrors.kernel.org/centos/6.2/os/i386/Packages/initscripts-9.03.27-1.el6.centos.i686.rpm. If you want to get an interface up, you can use "ifconfig eth0" or "dhclient" commands, or something like that. The network-scripts scripts are mainly wrappers for those, anyway. – cjc Feb 08 '12 at 14:17
2

Here's a list of what would have been in that directory and what some of those files would have looked like.

Type them in by hand until you can get the box back on the network.

Ladadadada
  • 26,337
  • 7
  • 59
  • 90