Public VS Private IP Address
- In networking, IP addresses are used to uniquely identify devices on a network
- Every device that connects to a network such as a computer, smartphone, printer, is assigned an IP address
Public IP address
- Assigned to your router by your internet service provider (ISP) and is used to identify your network on the internet
- Any device that communicates directly of the internet must has a public IP address
- This is what external Servers see
- Typically assigned to a router or gateway device that connects a local network to the internet
- The router acts as the gateway between the local network(with private IP) and the internet.
- It translates private IP to public IP using Network Address translations (NAT)
- Scope: Used for global identification on the internet
- Unique: Every public IP is unique across the internet to avoid conflicts
- Visibility: Public IP accessible from anywhere on the internet
- Security: Since Public IP are exposed to the internet, they are more vulnerable to external attacks. This is why firewalls and encryption important
- Allocation: Public IP addresses are typically assigned dynamically by ISPs, but can also be static for certain services or businesses that require a consistent address
- Types: There are two main versions of IP addresses in use today: IPv4 (e.g., 192.0.2.1) and IPv6 (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334)
- Cost: Public IP addresses are a finite resource and may incur additional costs from ISPs, especially for static assignments
Private IP address
- Used within a local network to identify devices internally
- Not directly accessible from the internet, providing an additional layer of security