What are Private and Public IP Addresses

Internet Protocol (IP) addresses are usually of two types: Public and Private. If you have ever wondered to know what is the difference between a public and a private IP address, then you are at the right place.

In this post I will try to explain the difference between a public and a private IP address in layman’s terms so that it becomes simple and easy to understand.

What are Public IP Addresses?

A public IP address is assigned to every computer that connects to the Internet where each IP is unique. In this case, there cannot exist two computers with the same public IP address all over the Internet. This addressing scheme makes it possible for the computers to “find each other” online and exchange information. User has no control over the IP address (public) that is assigned to the computer. The public IP address is assigned to the computer by the Internet Service Provider as soon as the computer is connected to the Internet gateway.

A public IP address can be either static or dynamic. A static public IP address does not change and is used primarily for hosting web pages or services on the Internet. On the other hand, a dynamic public IP address is chosen from a pool of available addresses and changes each time one connects to the Internet.

Most Internet users will only have a dynamic IP assigned to their computer which goes off when the computer is disconnected from the Internet. Thus when it is re-connected it gets a new IP.

You can check your public IP address by visiting www.whatismyip.com

What are Private IP Addresses?

An IP address is considered private if the IP number falls within one of the IP address ranges reserved for private networks such as a Local Area Network (LAN). The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private networks (local networks):

10.0.0.0 - 10.255.255.255 (Total Addresses: 16,777,216)
172.16.0.0 - 172.31.255.255 (Total Addresses: 1,048,576)
192.168.0.0 - 192.168.255.255 (Total Addresses: 65,536)

Private IP addresses are used for numbering the computers in a private network including home, school and business LANs in airports and hotels which makes it possible for the computers in the network to communicate with each other.

Say for example, if a network X consists of 10 computers, each of them can be given an IP starting from 192.168.1.1 to 192.168.1.10. Unlike the public IP, the administrator of the private network is free to assign an IP address of his own choice (provided the IP number falls in the private IP address range as mentioned above).

Devices with private IP addresses cannot connect directly to the Internet. Likewise, computers outside the local network cannot connect directly to a device with a private IP. It is possible to interconnect two private networks with the help of a router or a similar device that supports Network Address Translation.

If the private network is connected to the Internet (through an Internet connection via ISP), then each computer will have a private IP as well as a public IP. Private IP is used for communication within the network where as the public IP is used for communication over the Internet. Most Internet users with a DSL/ADSL connection will have both a private as well as a public IP.

You can know your private IP by typing ipconfig command in the command prompt. The number that you see against “IPV4 Address:” is your private IP which in most cases will be 192.168.1.1 or 192.168.1.2. Unlike the public IP, private IP addresses are always static in nature.

Common Myth about Private IP Address:

Most people assume that a private IP is the one used for stealth Internet activities and hence cannot be detected. But this is NOT TRUE!.

Unlike what most people think, a private IP address (unlike the private telephone number) is just like any other IP address that belongs to a private network. In reality, there is no public IP address that is impossible to trace as the protocol itself is designed for transparency.

36 Comments

  1. Harsh
    July 8, 2010 at 1:31 PM

    Hey very very useful post. i really dont know difference btwin public and private IP until i read this article.

    thanks for sharing.


  2. Vamshi
    July 8, 2010 at 2:22 PM

    Hi srikanth…

    GREAT WORK


  3. Vamshi
    July 8, 2010 at 2:24 PM

    Hi srikanth…

    GREAT WORK…

    i have a question , if we can create viruses in C, why they are not effective in Linux?


    • Srikanth
      July 8, 2010 at 6:10 PM

      @ Vamshi

      Virus created for windows in C/any language will not work on Unix/Linux due to change in the architechture.


  4. highnurse
    July 8, 2010 at 6:36 PM

    great tips .information thank you alot hope more and more..


  5. shivlu jain
    July 16, 2010 at 4:21 PM

    Post is very good. For more deep dive read RFC 1918 for private address ranges.

    regards
    Shivlu Jain
    http://www.mplsvpn.info


  6. waffles
    July 17, 2010 at 5:04 AM

    i remember one time when i was inschool and used the “shutdown -i” command in cmd and shutdown everyone it was soo easy to do and it made them look stupid not knowing who did it.that was when i started my interest in “hacking” although that wasn’t really a hack more of a “thing to do”


  7. Teddy
    August 7, 2010 at 1:34 AM

    it’s great reading here…


  8. Anand
    August 7, 2010 at 8:51 PM

    thats a gr8 info dude.. thnk u..

    also i have question

    “In ma college LAN we are required to enter a username and password(in a small dialog box saying dat FIREWALL AUTHENTICATION REQUIRED) to access the internet.. the matter is they are given only 4 the faculties and not 4 the students” i tried a lot to find someone’s usrname & passwd but i cant…

    could u please help to break dis firewall authentication…?


  9. silver-star
    August 13, 2010 at 4:33 PM

    thnx 4 sharin dis….


  10. Deep
    November 15, 2010 at 1:42 PM

    Thanks, sir for giving so much information to us.
    But you haven’t solve my problem. That I have commented in “How to Alter Windows Product ID”. Please Srikanth sir help me. I will be thankful to you.


  11. HELLHAWK0311
    December 17, 2010 at 10:47 PM

    Awesome, I’m going to spend some time on this website. I’m impressed with the way you explain things.


  12. basky
    January 13, 2011 at 10:14 PM

    thanks for sharing….. in our college they provide wi-fi connection ,can i increase my internet speed with any softwares r manually ? if u have any tips pls help me


  13. momo
    January 26, 2011 at 7:28 AM

    thks sri


  14. Rhodz Star
    January 26, 2011 at 12:07 PM

    it was really helpful and educational, I must continue reading and visiting this website…


  15. Dheeraj
    February 15, 2011 at 6:52 PM

    Thanks for sharing knowledge on Private and public addresses.
    Theconcept is defined in very clear and understandable form.


  16. Frank Jovine
    February 21, 2011 at 1:41 AM

    Well detailed article and something that can be of good use for forum owners as well.


  17. Ranjith
    March 11, 2011 at 2:22 AM

    Great boss you have given very use full information……


  18. Unah
    July 17, 2011 at 8:49 AM

    what are the curcumstances that would allow two computers to SHARE an IP adress? i know its possible. right now i am in a drop in center for homeless youth, and there are two computers. they both have the same IP adress.


    • Srikanth
      July 27, 2011 at 2:51 PM

      @ Unah

      I think you can share a single IP with those computers on a LAN.


  19. wilbert Daniel
    September 16, 2011 at 11:27 PM

    Hi gays this very very useful in it student like me…..

    thanks a lot


  20. ahmed
    October 22, 2011 at 2:33 AM

    thanks for that information?????????????


  21. daljeet
    April 15, 2012 at 4:03 PM

    how to know private ip of other…..well ur post r really awesome !!!


  22. ricky
    April 29, 2012 at 1:48 AM

    WHEN I M USING INTERNET,THEY R GIVING SAME SPEED……BT WHEN I M GOING 2 DIFFERENT SITES TO DOWNLOAD MOVIES ….THAN 1ST SITE TAKING 1HOUR TO DOWNLOAD BUT ANOTHER SITE TAKING 45MIN TO DOWNLOAD?/?

    HOW THERE IS A DIFFERENCE OF TIME TO DOWNLOAD , IF INTERNET SPEED IS SAME??????????????


  23. pavan
    May 13, 2012 at 3:00 PM

    very good post friend


  24. how can i trace a private ip address
    June 12, 2012 at 6:14 PM

    how would i trace a private ip address? please help!! thanx, danny


  25. Pranjal
    July 15, 2012 at 3:26 PM

    hi……….Srikanth……….
    Can you pls tell me that the public ip address is assigned to router or computer????…


    • Srikanth
      September 4, 2012 at 2:21 PM

      @ Pranjal

      It is assigned to the router of the computer.


  26. Shubham Agarwal
    July 21, 2012 at 9:05 PM

    Nice post……………


  27. sanju
    August 15, 2012 at 10:39 PM

    i want “What are Private and Public IP Addresses” in pdf file…

    so i can download it…


  28. Koushik
    August 21, 2012 at 4:43 PM

    Your blog is mind blowing.. Its very helpful to know about this thing..


  29. nirav DESAi
    September 14, 2012 at 8:20 PM

    you can also check your ip by typing ipconfig/all in cmd..it also show mac address(physical address) of your network interface card.


  30. Shree
    September 25, 2012 at 7:59 PM

    Hi Shirkant Sir,

    I have recently got my eyes on your blog. You are really doing great work and your tuts are found to be much useful.
    Between, I got a problem, hope you will try to solve it though its a Foolish. ;)
    I have hosted one Counter Strike 1.6 Server and people can join the IP of my server to play CS. Some of the people uses hacks and cheat to get good score in game. As an admin I have command to ban those players by their IP who are cheating and annoying server rules. But today the main problem is that most of players uses dynamic IP, so there will be no use to ban them as they will join again the server after resetting their modem which in turn changes their IP [Banned IP].
    Is there any way to get rid of this problem. Like is there any way that I can stop all the possible IP’s from that players root ?


  31. Rajkamal
    October 1, 2012 at 11:59 AM

    Srikant ji

    Thanks for providing useful information on IP addresses.


  32. SAM
    October 2, 2012 at 8:57 PM

    Great work keep posting dude..


  33. saad saleem
    October 6, 2012 at 11:28 AM

    great job man……that is very helpfull….thankx alot…..


Leave A Reply