Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup two network profiles in Centos. One for at home, one for at work. The home profile has a fixed IP address, fixed gateway and DNS server addresses. The work profile depends on DHCP.

I've created a 'home' and a 'work' directory in /etc/sysconfig/networking/profiles. Each has the following files containing the proper configuration:

> -rw-r--r-- 2 root root  422 Apr 17 20:17 hosts
> -rw-r--r-- 5 root root  223 Apr 17 20:18 ifcfg-eth0
> -rw-r--r-- 1 root root  101 Apr 17 20:17 network
> -rw-r--r-- 2 root root   73 Apr 17 20:18 resolv.conf

There was already a 'default' profile, which contains the same files.

The I issued these commands:

system-config-network-cmd --profile work --activate
service network restart

I was expecting these files to get copied from the profiles/work directory to /etc/sysconfig/ and /etc/sysconfig/networking-scripts. And most files do get copied, except for ifcfg-eth0.

Stangely enough that files seems to be overwritten with the current settings when I issue system-config-network-cmd. The other files are also touched, but there contents stays in tact.

The system is Centos 5.7 running on a virtual pc within a windows 7 machine. Here is the output for ifconfig:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:03:FF:6F:2E:AB
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::203:ffff:fe6f:2eab/64 Scope:Link
          RX packets:4199761 errors:7 dropped:0 overruns:0 frame:0
          TX packets:1733750 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2316624688 (2.1 GiB)  TX bytes:415533386 (396.2 MiB)

Can someone tell what I'm missing here?

share|improve this question

To access a virtual machine configured within IP range assigned from router - from home network -, we can use the following procedure:

Inside your virtual machine, type ‘neat’ command which is used to configure network adapters. As of now, we have configured two adapters – loopback and one with IP for example. If we have to use this virtual machine on another network, then we need to add another adapter using ‘New’ option that we get with neat. We need to add a new network adapter and assign IP in the range of host network. For example, the IP for this network adapter should be (the permissible range in your network), (subnet mask), (default gateway). Save these settings. In /etc/resolv.conf file you need to add an entry – nameserver In /etc/hosts file, add another entry for this new IP ie. example () and restart network service.

Ping windows machine from linux and linux machine from windows, you should be able to ping it. NO CHANGE is needed in windows host file, if you wish to access your virtual machine with IP address. But if you want to use hostname, then you need to add another entry in c:/windows/system32/drivers/etc/hosts files – example, considering your machine hostname is example, as hosts file is used for name resolution.

So you can work in bridged environment without changing any IP at home and office.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .