≡ Menu

What is an IP Address? IPv4 and IPv6 Address Examples

Question: I’ve been playing around with Linux desktop distro for a while. But, I’m very new to networking. Can you explain me in simple terms about what is an ip address and give me an example?

Answer: When someone mails you a postal letter, you get it. How? Because it has an address that uniquely identifies your home. Pretty basic. Right? Just like your home, every system in the Internet need to have an unique address for someone to find it. That is called an ip address.

Even when the servers are not on the internet, within your own private network, every system need to have a unique ip-address, if you like the machines in your network to talk to each other.

Every system can be accessed using both ip-address and their domain name. For example, when you ping yahoo.com, you’ll see the public ip-address it is using. So, both http://yahoo.com and will take you to the same website.

# ping yahoo.com
PING yahoo.com ( 56(84) bytes of data.

IPv4 Address Example

An example ip-address:

The above ip-address is in the dotted decimal number format. An ip address is in the format of 4 sets of decimal numbers separated by dots. The decimal number in each and every set is in the range 0 to 255. Each and every set is called octet. So, there are 4 octets in an ip address.

However systems understands ip-address only in the binary format. So, when you configure your system with an ip-address in a dotted decimal number format, it is converted to a binary number format internally by the system as shown below.


IPv4 IP address are 32 bit numbers. In the above binary format, there are total of 32 binary numbers. Each and every binary number that are separated by the dot is converted to its corresponding binary number. There are total of 4 bytes here.

Each and every octet can have a value from 0 to 255. Since there are 4 octets in an ip-address, the total possible combination of unique ipv4 ip addresses are 4,294,967,296.

IPv6 Address Example

IPv4 stands for Internet Protocol Version 4. Most of the networks and systems in the internet is currently configured for IPv4. Since IPv4 ip address has only 32 bits (a total of 4,294,967,296 unique ip-addresses), the ip addresses in the internet are running out quickly. Please note that there is a big block of these ip addresses are reserved for special purposes (for example, private network and multicast addresses).

IPv6 stands for Internet Protocol Version 6. Since there is a possibility that we might run out of ip address in the internet, IPv6 was developed. IPv6 ip address has 128 bits. This is a huge improvement from the 32 bit ipv4 ip address. While lot of networks are getting configured for both IPv4 and IPv6, there is still a huge number of networks and systems in the internet that works only for IPv4. But eventually all these systems might go towards the IPv6 route.

IPv6 ip address is typically written in hexadecimal separated by colon. A colon separates 16 bit. The following is an example of IPv6 address:


Leading zeros can be truncated. For example “0000” can be be just written as empty. In the above example :: indicates that it has multiple 0’s in that location. Typically the IPv6 format can be written down in three ways 1) compressed, 2) uncompressed and 3) fully uncompressed as shown below. All of the following are the same:

  • IPv6 Compressed (0000 is not displayed) – 2002:4559:1FE2::4559:1FE2
  • IPv6 Uncompressed (0000 is displayed as 0) – 2002:4559:1FE2:0:0:0:4559:1FE2
  • IPv6 Fully Uncompressed (0000 is fully displayed) – 2002:4559:1FE2:0000:0000:0000:4559:1FE2

Execute “ifconfig -a” which will display both ipv4 and ipv6 ip-addresss (if it is configured appropriately):

# ifconfig -a | egrep 'inet|inet6'
   inet addr:
   inet6 addr: 2002:4559:1fe2::4559:1fe2
Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • jalal hajigholamali January 18, 2012, 8:57 pm


  • jim January 19, 2012, 6:53 am

    nicely written & very understandable. thanks!

  • Karthik.P.R January 20, 2012, 2:09 am

    Thanks for providing a detailed information about IPv6.

    (MySQL DBA)

  • Lu Fleszar January 20, 2012, 6:18 am

    By putting in the :: notation ,it seemed to show how a group of 0’s is noted.In the expanded version you show three sets of 0000:0000:0000 which totally baffled me.Nowhere do you show a normal Ipv6 address without the 0’s

  • manojkumar January 21, 2012, 8:26 am

    nice one … it can be still better if u explains about private ip and public ip 🙂 thanks for the valuable information always

  • Dave January 31, 2012, 8:25 am

    I’m confused too about how :: turned into :0:0:0: — shouldn’t it be ::::?

  • R. Zwicker February 1, 2012, 1:10 pm

    Also interesting to note the ipv4 to ipv6 translation.
    For inet addr: and inet6 addr: 2002:4559:1fe2::4559:1fe2
    hex 45 = dec 69
    hex 59 = dec 89
    hex 1f = dec 31
    hex e2 = dec 226

  • sumit dinodiya July 22, 2012, 10:46 pm

    Hello sir , your blogs are full of practical information and your language is also simple and easy to understand………….and i have doubt regarding ip adressess , now they are cleared……..thanks..

  • priya January 30, 2013, 12:21 am

    Hello sir, I have a doubt…. can u differentiate between MPLS and MPLs-VPN?

  • SATHISH August 28, 2013, 7:37 pm

    Easy to understand

    thanking you


  • Raju October 23, 2013, 4:43 am

    Really good..

    Felt like understood something about Networking..

  • Anch January 2, 2014, 1:09 pm

    Beautifully explained 🙂

  • sadiya June 8, 2015, 1:03 am


  • Naveen June 17, 2015, 12:42 am


  • Mahendra Kumar Meena February 16, 2016, 9:51 pm


  • khalik April 25, 2016, 2:25 pm


  • McJulsIT March 29, 2017, 3:53 pm

    Great Job.

  • Steve Hall April 8, 2017, 12:44 am

    ifconfig didn’t work on my Win10 system. It was not recognized as a available command.