Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've installed centos in a vmware vm in attempt to learn more about system administration. Unfortunately, I was unable to ping the host machine (win7) from the vm or vice versa, even though a third computer on the network was able to ping both. After disabling the firewalls and spending the last 5 hours looking on Google, I was still unable to ping between the host and guest.

Per the suggestions from a thread I found about others having a similar problem, I made changes to the ifcfg-eth0 file. Unfortunately, I didn't save a copy of the file before I made the changes and now I have a corrupted network setup and am not seeing the eth0 device.

Though I'd like to solve this problem and the pinging problem, my question here is: How am I supposed to recover from making changes like these? I have no idea how to get myself back to a working configuration from here.

I'm sure an experienced systems administrator wouldn't make mistakes like these, especially without making copies of the files in advance, but assuming a mistake did occur, what's the recourse?

share|improve this question
    
what type of network do you use Nat/Bridge/Host Only? –  ALex_hha Jul 18 '13 at 7:18
    
Full details on the issue described: Host machine is win7 with ip 192.168.1.103. Vm is centos with ip 192.168.1.66 (static) installed on vmware with a bridged connection. The ping fails with a destination host unreachable. –  mowwwalker Jul 18 '13 at 7:23
    
I'm also unable to ping the win7 vm –  mowwwalker Jul 18 '13 at 7:36

4 Answers 4

I think the following settings would be enough

# /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.66
NETMASK=255.255.255.0
BROADCAST=192.168.1.255

After that restart network

# service network restart
share|improve this answer

How am I supposed to recover from making changes like these?

The answer to your original question is - use snapshots. VMWare lets you save the state of a Virtual machine and restore it later on, rolling back all the changes. And always do backups of your configuration files before you mess something up

share|improve this answer

maybe you want to read the "Unix Haters Handbook" in advance.

if you are lucke you'll have a backup-file flying around, ending in ~ or ##; check with ls -la

Unix (still) has no tools for "incidents" like this. what people do to prevent such hickups:

  • use a scm like git to manage and track changes of config-files
  • use a cronjob that commits any changes on a daily basis
  • have /etc and other config-dirs in a daily backup
share|improve this answer

The way to reliably make changes in a system with the ability to restore the system to a known state afterwards is using a configuration management system and a source code repository.

Backups and snapshots are useful for disaster recovery, but overkill to handle a simple change like this one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.