Private vs. Public IPs & SSH

Learn about private vs public IP addresses, SSH key pairs, security groups, and how to securely access your EC2 instances.

networking-config.json
{
"KeyName": "my-key-pair",
"SecurityGroupIds": ["sg-123456"],
"AssociatePublicIpAddress": true
}
networking-config.json
1 / 13
🌐

Tutor:EC2 instances can have both private and public IP addresses. Understanding the difference is crucial for network security and access control. Private IPs are used for internal communication, while public IPs allow internet access.


Networking Mastery

Unlock nodes by learning new networking concepts.

Concept 1: Networking Basics

EC2 instances can have both private and public IP addresses. Understanding the difference is crucial for network security and access control. Private IPs are used for internal communication, while public IPs allow internet access.

System Check

What is the main difference between private and public IP addresses?


Community Holo-Net

Showcase Your EC2 Networking Configurations

Built secure EC2 setups? Share your IP configurations and SSH key pair strategies.

Private vs. Public IPs & SSH (Key Pairs)

Author

Pascual Vila

Cloud Instructor.

EC2 instances can have both private and public IP addresses. Understanding the difference is crucial for network security and access control. Private IPs are used for internal communication, while public IPs allow internet access.

Private IP Addresses

A private IP address is only accessible within your VPC and cannot be reached from the internet. Private IPs are used for communication between instances within the same VPC or connected networks.

Public IP Addresses

A public IP address is reachable from the internet. EC2 instances in public subnets typically get public IPs automatically. Public IPs are used when you need to access your instance from the internet.

SSH Key Pairs

SSH (Secure Shell) is a protocol for securely accessing remote servers. AWS uses SSH key pairs for authentication instead of passwords. You create a key pair, download the private key, and use it to connect to your EC2 instances.

Networking Glossary

Private IP Address
An IP address that is only accessible within your VPC and cannot be reached from the internet. Used for internal communication between instances.
Public IP Address
An IP address that is reachable from the internet. EC2 instances in public subnets typically get public IPs automatically.
Elastic IP Address
A static public IP address that you can allocate and associate with your EC2 instances. Unlike regular public IPs, Elastic IPs remain the same even if you stop and start your instance.
SSH Key Pair
A pair of cryptographic keys (public and private) used for SSH authentication. AWS stores the public key on the instance, and you keep the private key secure to authenticate when connecting.
Security Group
A virtual firewall for your EC2 instances. You configure rules to allow or deny traffic based on protocol, port, and source. By default, all inbound traffic is denied and all outbound traffic is allowed.