Private vs Public IP
-
There are two sorts of IPs: IPv4 and IPv6
-
IPv4
- ex) 1.160.10.240
- Most common format
- Allows 3.7 billion (256^4) but running out of space
-
IPv6
- ex) 1900:14545:3:200:f8ff:fe21:67cf
- newer and solves problems for IoT

-
Computers within private network can communicate with each other
-
Private network needs Internet Gateway to communicate with outside
Public IP
- Machine can be identifed on the Internet
- Unique across the whole web
- Geo located easily
Private IP
- Machine can only be identified on a private network
- Unique across the private network
- Difference private networks can have the same IPs
- Machines connect to WWW using a NAT + Internet Gateway as a proxy
- Only a specified range of IPs can be used as private IP
By default, EC2 comes with both private IP for internal AWS network and public IP for www
When doing SSH, cannot use private IP because we are not in the same network => use public IP
Elastic IP
- Stopping and starting an instance can change its public IP
- Elastic IP allows to have a fixed pulibc IP for an instance
- IPv4 IP that I own unless I delete it
- One instance at a time
- 5 Elastic IP for one account -> can ask AWS for more
Avoid using Elastic IP, because it reflects poor architectural decisions. Use random public IP or register a DNS name to it, or use a Load Balancer and don't use a public IP