Wednesday 24 June 2015

Edit Ip Addresses With Centos

The CentOS Linux Operating System contains a configuration file for each network adapter attached to the system. These adapters, such as Ethernet and wireless cards, contain Internet Protocol (IP) addresses that identify them on a network, such as a home Wi-Fi setup or the Internet. When your computer exists on a network such as a data center, which uses statically assigned IP addresses, you must edit your adapter configuration file if the IP address changes.


Instructions


1. Obtain a list of all IP addresses assigned to your system from your Internet Service Provider (ISP) or Network Administrator. Although home systems typically have only one address, data center computers are often assigned numerous addresses.


2. Log in to your CentOS system using your user name and password.


3. Click "Applications," then select "Accessories" and "Terminal" from your desktop panel.


4. Log in as the root user of the system. Type "su root" without quotation marks, then press "Enter." Enter your root password when prompted, then press "Enter" again.


5. Back up your current network configuration files to the protected "root" storage area. Type the following, then press "Enter":


cp /etc/sysconfig/network-scripts/ifcfg-eth* /root/networkbackups/


6. Type the following to open your first network configuration file:


nano /etc/sysconfig/network-scripts/ifcfg-eth0


7. Press the down arrow key on your keyboard until you reach the line that reads "NETWORK=" where is your current IP address.


8. Move the cursor with the arrow keys until it is to the right of the IP address. Press "Backspace" until the line reads "NETWORK=".


9. Type the new IP address for the adapter immediately following the "=" sign. For example, if your new IP address is "10.0.10.10" the line should read "NETWORK=10.0.10.10" without the quotation marks.


10. Press "Ctrl+O" on your keyboard to write the current document to the disk. Press "Y" to confirm the action.


11. Repeat Steps 6 to 10 for any additional adapters to which you must assign an IP address. The number of the configuration file goes up for each additional adapter on your computer. For example, use the following command to open your second adapter:


nano /etc/sysconfig/network-scripts/ifcfg-eth1

Tags: configuration file, press Enter, sysconfig network-scripts, then press, then press Enter