Thursday, July 22, 2010

How to Change the ip address in Linux

Change the ip address in Linux:



YOU CAN USE ANY ONE OF THE FOLLOWING METHODS.

METHOD 1(GUI) :

[root@localhost ~]#system-config-network
(a)Select the ethernet interface(Eg:eth0) and change the ip and netmask.
OR
[root@localhost ~]#setup
(a)Select the 'Network configuration' tab.
(b)Select the ethernet interface(Eg:eth0) and change the ip and netmask.



METHOD 2(SCRIPT) :

[root@localhost ~]#cd /etc/sysconfig/network-scripts/
[root@localhost ~]#vi ifcfg-eth0
Enter the new ip in this script file.



METHOD 3(COMMAND LINE) :

(Make sure you are not changin the remote hosts ip. If you use this command to change the remote host ip, you will lost the commection)

Set new ip to 192.168.1.11
[root@localhost ~]#ifconfig eth0 192.168.1.11
Set new ip with nermask
[root@localhost ~]#ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up



.