Private vs Public IP Addresses
Understanding the difference between private and public IP addresses, NAT implications, and quick identification methods.
What's the Difference?
Private IP addresses are used within local networks and are not routed on the public internet. Public IP addresses are globally unique and can be reached from anywhere on the internet. The key difference is reachability: private IPs are only reachable within their local network, while public IPs are reachable from anywhere on the internet.
Private IP Address Ranges (RFC 1918)
10.0.0.0 to 10.255.255.255
10.0.0.1
10.1.1.1
10.200.50.100
172.16.0.0 to 172.31.255.255
172.16.0.1
172.20.1.1
172.31.255.254
192.168.0.0 to 192.168.255.255
192.168.1.1
192.168.0.100
192.168.100.50
Public IP Addresses
All IP addresses not in private, reserved, or special-use ranges
Characteristics
- Globally unique and routable on the internet
- Assigned by Regional Internet Registries (RIRs)
- Can be reached from anywhere on the internet
- Cost money to obtain and maintain
- Limited supply (IPv4 exhaustion)
Examples
Public IP | Owner/Service |
---|---|
8.8.8.8 | Google Public DNS |
1.1.1.1 | Cloudflare DNS |
13.107.42.14 | Microsoft services |
151.101.193.140 |
NAT (Network Address Translation) Implications
Process:
- Device with private IP (192.168.1.100) wants to access internet
- Router/NAT device translates to public IP (203.0.113.50)
- Internet sees traffic from public IP, not private IP
- Return traffic is translated back to private IP
Benefits:
- Allows many devices to share one public IP
- Provides security through address hiding
- Conserves public IP addresses
- Enables local network management
Challenges:
- Private IPs are not routed on internet
- NAT blocks unsolicited inbound connections
- Port forwarding needed for specific services
- VPN required for general access
Solutions:
- Port forwarding for specific services
- VPN for secure remote access
- DMZ for less secure but simple access
- Reverse proxy for web services
Quick Identification Methods
Method | Description | Private Indicator | Public Indicator |
---|---|---|---|
IP Range Check | Look at first octets of IP address | 10.x.x.x, 172.16-31.x.x, 192.168.x.x | Any other address not in reserved ranges |
Reachability Test | Try to reach from external network | Cannot be reached from internet | Can be reached from internet (if not firewalled) |
Router Configuration | Check WAN vs LAN interface addresses | LAN interfaces use private addresses | WAN interface uses public address (unless CGNAT) |
Useful Tools
Common Network Scenarios
Troubleshooting Common Issues
Possible Causes: Server has private IP, No port forwarding, Firewall blocking
Diagnosis: Check if server IP is private, test port forwarding
Solution: Configure port forwarding or use public IP
Possible Causes: Both using same private range, No routing configured
Diagnosis: Check for IP address conflicts, routing tables
Solution: Use different private ranges or configure routing
Possible Causes: Private IP conflicts, NAT traversal issues
Diagnosis: Check for address space overlap
Solution: Reconfigure IP ranges or use different VPN protocol
Security Considerations
- Private IPs provide security through obscurity
- Still need internal security measures
- Lateral movement possible within private networks
- Monitor internal network traffic
- Public IPs are constantly scanned and attacked
- Require robust firewall and security measures
- DDoS protection may be necessary
- Regular security updates and monitoring essential
Best Practices
- Use private IPs for internal networks
- Reserve public IPs for internet-facing services only
- Plan private IP ranges to avoid conflicts
- Document your IP addressing scheme
- Use DHCP for dynamic private IP assignment
- Implement proper firewall rules for public IPs
- Monitor public IP usage and costs