How to Set / Change IP address in Linux Machine

There are actually different ways in which you can change IP address in Linux. One of them is by the use of command line tools. The second method is the way of modifying configuration files. The third method is through the use of GUI (Graphical User Interface) tools. The sequence of steps can be given as follows:
ipaddressinlinux-1.jpg

Step 1: Display current setting and IP address In the first step, you need to display the current IP address and setting for the network interface which is known as eth0. This can be done by the use of the following ifconfig command:
# ifconfig eth0
The output of the above command shall be something like this shown below:
eth0 Link encap:Ethernet HWaddr 00:30:48:5A:BF:46
inet addr:10.5.123.2 Bcast:10.5.123.63 Mask:255.255.255.192
inet6 addr: fe80::230:48ff:fe5a: bf46/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:728204 errors:0 dropped:0 overruns:0 frame:0
TX packets:1097451 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62774749 (59.8 MiB) TX bytes:1584343634 (1.4 GiB)
Interrupt:177


Step 2: Change IP address
In the next step, you need to change the IP address. This can easily be done with the help of the ifconfig command itself. For the purpose of setting the IP address 192.168.2.5, all you need to enter is the following command:
# ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
# ifconfig eth0
Now, for the purpose of changing the IP address permanently, all you need to do is edit the configuration file according to your Linux Distribution.
For information, Linux refers to the family of Unix-like computer operating systems using the Linux kernel. Linux can be installed on a wide variety of computer hardware, ranging from mobile phones, tablet computers and video game consoles, to mainframes and supercomputers. The development of Linux is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed, both commercially and non-commercially, by anyone under licenses such as the GNU General Public License. Typically Linux is packaged in a format known as a Linux distribution for desktop and server use. Linux distributions include the Linux kernel and all of the supporting software required to run a complete system, such as utilities and libraries, the X Window System, the GNOME and KDE desktop environments, and the Apache HTTP Server.
An Internet Protocol address (IP address) is a numerical label that is assigned to any device participating in a computer network that uses the Internet Protocol for communication between its nodes. An IP address serves two principal functions; host or network interface identification and location addressing. Its role has been characterized as follows: “A name indicates what we seek. An address indicates where it is. A route indicates how to get there.” The designers of TCP/IP defined an IP address as a 32-bit number and this system, known as Internet Protocol Version 4 (IPv4), is still in use today. However, due to the enormous growth of the Internet and the predicted depletion of available addresses, a new addressing system (IPv6), using 128 bits for the address, was developed in 1995, standardized by RFC 2460 in 1998, and is in world-wide production deployment.

Set ip address on Linux (Video Guide):

 
Top