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:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::203:ffff:fe6f:2eab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
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)
Interrupt:9
Can someone tell what I'm missing here?