‫So before we learn about VPCs in AWS,
‫let's talk about IP addresses in AWS.
‫So we have two kinds of IP.
‫We have IPv4 and IPv6.
‫IPv4 means internet protocol version four
‫and the capacity is about 4.3 billion IPv4 addresses.
‫So we know about public IPv4s.
‫They are IP fours that can be used on the internet.
‫And whenever we create an EC2 instance,
‫it's going to get a new public IPv4
‫as well as if you stop it and then you start it,
‫it's going to get a new public IPv4 address.
‫And this is something that we've witnessed
‫throughout this course.
‫We've also seen private IPv4.
‫So this is an internal IP that can be used
‫within your own network.
‫For example, 192.168.1.1,
‫and this private IP four is going to be constant
‫for your EC2 instance lifecycle,
‫even if you stop and then start it again.
‫So the difference is that private IPv4 is constant,
‫but public IPv4 will get released
‫if you stop your instance
‫and you'll get a new one whenever you start your instance.
‫Which brings us to the concept of elastic IPs.
‫So Elastic IPs allows you
‫to create a fixed IPv4 address
‫and then you can attach it to your EC2 instance.
‫So even if you stop your EC2 instance
‫and then you start it as long as
‫it has the elastic IP attached to it,
‫it's going to keep the same public IPv4
‫so that it can be desirable, but there is a cost to it.
‫So if you leave it attached to your EC2 instance,
‫you don't pay for it.
‫But if your EC2 instance is stopped,
‫or your elastic IPv4 is not attached to anything,
‫then you're going to have an ongoing cost
‫because AWS needs to pay to keep that public IP alive
‫and within its own network.
‫So that's why Elastic IP can be beneficial
‫to have a fixed IPv4 that's public,
‫but also can cost you some money
‫if you don't use it or if the EC2 instance is stopped.
‫Finally, we have IPv6.
‫So this is the next evolution of the internet protocol,
‫and I will not name how many addresses that is,
‫it is a lot of more addresses,
‫about 3.4 times 10 at the power of 38,
‫so quite lot addresses.
‫Each IP is going to be public.
‫There is no private range and they look like this.
‫And you can actually enable your VPC
‫to use IPv6 as well.
‫So that's it for this lecture.
‫I hope you liked it and I will see you in the next lecture.