What is public and private IP?

Jinwon Park
1 min readNov 1, 2021

A public IP address in an unique and open IP address assigned by Internet Service Provider(ISP).

It acts as a P.O. box to your home. You can find out your public IP address using following command.

curl ifconfig.mecurl: client url
ifconfig: interface configuration

A private IP address is an IP address that is assigned to local computing device. It is unique only with in your local network, not globally.

Let’s say I am using my laptop, and my smartphone sharing the wifi from the router.

Public IP for both devices would be the same, but the private IP assigned by my router would be different and unique for my devices.

So, when I access www.medium.com through my laptop, the wifi router changes my private IP to public IP, and sends the data.

When receiving, my router changes the destination to private IP, so that my laptop would get the information, not the smartphone.

Static vs Dynamic IP

Static IP is IP fixed to the device. It can not be assigned to other devices unless that device returns the IP.

Dynamic IP is the opposite. The devices get assigned the remaining IPs when the device is being used.

If you want to provide a server, you would need to set the IP to static, so that the clients can reach your server every time.

--

--