Lec02-Publicip vs private ip
What is public Ip address vs Private Ip address ?
Both public and private IP addresses play important
roles in Azure resources, but they serve different purposes:
Public IP
addresses:
- Accessibility: Accessible from the internet, allowing resources
like web servers to be directly accessed.
- Use cases: Hosting websites, remote desktop access, public-facing
applications, accessing external services.
- Cost: Charges apply for using a public IP address.
- Management: Can be assigned statically (dedicated) or dynamically
(temporary), and can be associated with multiple resources.
Private IP
addresses:
- Accessibility: Only accessible within the virtual network where the
resource is located.
- Use cases: Internal communication between resources, secure hosting
behind a load balancer or firewall.
- Cost: No additional charges for using a private IP address.
- Management: Automatically assigned by Azure within the subnet's
address range and cannot be accessed directly from the internet.
Choosing
between a public and private IP depends on your specific needs and security
requirements.
Here are
some additional things to consider:
- Dynamic vs. static public IP: If you require consistent IP address,
choose a static public IP. Otherwise, a dynamic IP might be sufficient.
- Outbound connections: Even with a private IP, outbound connections
to the internet are possible through Azure NAT (Network Address
Translation).
- Load balancers and firewalls: Public IP can be associated with a
load balancer for distributing traffic among resources, while private IPs
can be secured behind a firewall for enhanced protection.
Here's a breakdown of dynamic and static public IP
addresses in Azure:
Dynamic
Public IP:
- Assignment: Not assigned immediately upon creation. IP is allocated
when associated with a resource (like a VM).
- Release: IP is released when the resource is stopped or
deallocated, and might change when restarted.
- Cost: Generally lower cost compared to static IPs.
- Use cases:
- Temporary resources
- Resources without a dependency on a fixed IP address
- Development and testing environments
Static
Public IP:
- Assignment: Assigned permanently when created and remains
associated with your account until explicitly released.
- Persistence: IP persists even if the associated resource is
stopped, deallocated, or moved.
- Cost: Typically higher cost than dynamic IPs.
- Use cases:
- Resources requiring a consistent, predictable IP address
- Production environments
- DNS records pointing to specific IPs
- Access control lists (ACLs) based on IP addresses
- VPN connections
Key differences:
- Changeability: Static IPs remain constant, while dynamic IPs can
change under certain conditions.
- Cost: Static IPs usually have a higher cost than dynamic IPs.
- Suitability: Static IPs are better suited for resources requiring a
fixed IP, while dynamic IPs are appropriate for temporary or non-critical
resources.
Additional considerations:
SKU:
Azure offers Basic and Standard SKUs for public IP addresses.
- Basic SKU supports only dynamic IPs.
- Standard SKU supports both static and dynamic IPs.

Comments
Post a Comment