The file located in /etc/sysconfig/networking/profiles are created by the GUI network interface management tool. These files should not be edited manually and when changes need to be made they should be made directly to the files as shown below. CentOS 5 is easy to get around from the command line and it is beneficial to understand each of the below files if you are going to manage a server.
Need to make a change to hostname?
First modify /etc/sysconfig/network and modify the following line:
Also make sure you modify /etc/hosts to include lines like the following.
127.0.0.1 localhost.localdomain localhost
192.168.0.10 someother someother.yourdomain.com
192.168.0.20 thisserver thisserver.yourdomain.com
Need to modify the IP address of an Ethernet interface?
Modify the IP information in /etc/sysconfig/network-scripts to something like the below:
If your primary Ethernet interface is eth0 the file would be /etc/sysconfig/network-scripts/ifcfg-eth0 and its contents will look similar to this:
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
Before you make any changes to the network configuration make sure you understand the change you are making. Its always a good idea to back up each file before you make a change to it though make sure you do not back it up to the same directory as it could be read as an active file depending on how you name it and you will wonder why your changes aren’t working! Also once you have made changes and you are about to reboot or restart networking (/etc/init.d/network restart) double and triple check your changes to make sure they are accurate.
This is a great book on Linux networking!