How to Find IP Address in Linux
Well, the answer on how to find ip address in linux can be very simple. However, here in this article on linux, how to find ip address will not be the only question answered. I will also give you the basic information on what is an ip address and how can we assign a new ip address to a computer in linux...

What is an IP Address?
For those of you who don't know exactly the use of an ip address, let me try to explain it to you in detail. An ip address is an abbreviation for 'Internet Protocol' address. Well, ip addresses are 32 bit numbers stored in binary format, but displayed to the user in human readable form. It is used to identify the different machines in a network. Every machine in a network needs a unique ip address. This helps in the transfer of data as the number specifies the name of the machine, the address, as well as the route. Another important aspect, 32 bit numbers are used for the IP version 4 or IPv4, but in case of Ipv6 (IP version 6) 128 bits are used for addressing the computers in a network. The ip address is usually represented in the form of x.x.x.x where x is an 8 bit number. This was just a basic idea on what an ip address is. With this much knowledge in hand, let us go on to search the answer for the question related to linux, how to get ip address in linux.
How to Find an IP Address in Linux
The simplest way to check the ip address of linux, when using the bash shell is typing the command ifconfig. On typing the ifconfig you will not only be provided with the ip address, but also the mac address, subnet mask and other information. If you get confused because of the huge amount of information displayed on typing the ifconfig command, then let me tell you that the number following the inet addr under eth0 is the ip address of the machine on which you are working. Alternately, you can also use the command ip address show. On typing the command you will get the output something like, inet 192.168.1.15/24. Here the /24 means that the subnet mask is 255.255.255.0. Similarly /8 would mean that the subnet mask is 255.0.0.0.
How to Change IP Address
Changing ip address in linux is as easy as viewing the ip address. On the bash shell type ifconfig eth0 192.168.254.8 net mask 255.255.255.0 up. Here 192.168.254.8 is the new ip address. Using this command, you can set your ip address for that particular session to this particular ip address. But to change the ip address permanently, you need to change the configuration file and the process to do so depends on your Linux version. Let me give you an example. To change the ip address permanently in Red Hat Linux, login as the root and type the command system-config-network-tui &. You will now see a text based GUI. Click on the option to enlarge image. Here you can make all your changes. You can set your network interface card, set your ip address, subnet mask and default gateway or you can simply select the option for DHCP (Dynamic Host Configuration Protocol) to assign you the ip address automatically.
This was all the information that I can provide you on how to find ip address in linux. It is a simple process. Here, in this article, I have tried to implement the command line approach for it is the command line interface which attracts so many computer users to this wonderful operating system.
Like This Article?
Follow:

Post Comment


