1 00:00:00,150 --> 00:00:03,450 ‫So before we learn about VPCs in AWS, 2 00:00:03,450 --> 00:00:06,240 ‫let's talk about IP addresses in AWS. 3 00:00:06,240 --> 00:00:07,590 ‫So we have two kinds of IP. 4 00:00:07,590 --> 00:00:09,960 ‫We have IPv4 and IPv6. 5 00:00:09,960 --> 00:00:13,110 ‫IPv4 means internet protocol version four 6 00:00:13,110 --> 00:00:18,110 ‫and the capacity is about 4.3 billion IPv4 addresses. 7 00:00:18,180 --> 00:00:20,070 ‫So we know about public IPv4s. 8 00:00:20,070 --> 00:00:23,370 ‫They are IP fours that can be used on the internet. 9 00:00:23,370 --> 00:00:25,533 ‫And whenever we create an EC2 instance, 10 00:00:25,533 --> 00:00:28,920 ‫it's going to get a new public IPv4 11 00:00:28,920 --> 00:00:31,863 ‫as well as if you stop it and then you start it, 12 00:00:31,863 --> 00:00:35,220 ‫it's going to get a new public IPv4 address. 13 00:00:35,220 --> 00:00:37,050 ‫And this is something that we've witnessed 14 00:00:37,050 --> 00:00:38,730 ‫throughout this course. 15 00:00:38,730 --> 00:00:40,950 ‫We've also seen private IPv4. 16 00:00:40,950 --> 00:00:44,430 ‫So this is an internal IP that can be used 17 00:00:44,430 --> 00:00:45,870 ‫within your own network. 18 00:00:45,870 --> 00:00:49,830 ‫For example, 192.168.1.1, 19 00:00:49,830 --> 00:00:54,090 ‫and this private IP four is going to be constant 20 00:00:54,090 --> 00:00:56,580 ‫for your EC2 instance lifecycle, 21 00:00:56,580 --> 00:00:59,280 ‫even if you stop and then start it again. 22 00:00:59,280 --> 00:01:01,860 ‫So the difference is that private IPv4 is constant, 23 00:01:01,860 --> 00:01:04,350 ‫but public IPv4 will get released 24 00:01:04,350 --> 00:01:05,520 ‫if you stop your instance 25 00:01:05,520 --> 00:01:09,150 ‫and you'll get a new one whenever you start your instance. 26 00:01:09,150 --> 00:01:12,270 ‫Which brings us to the concept of elastic IPs. 27 00:01:12,270 --> 00:01:14,100 ‫So Elastic IPs allows you 28 00:01:14,100 --> 00:01:17,190 ‫to create a fixed IPv4 address 29 00:01:17,190 --> 00:01:20,190 ‫and then you can attach it to your EC2 instance. 30 00:01:20,190 --> 00:01:23,040 ‫So even if you stop your EC2 instance 31 00:01:23,040 --> 00:01:24,870 ‫and then you start it as long as 32 00:01:24,870 --> 00:01:27,270 ‫it has the elastic IP attached to it, 33 00:01:27,270 --> 00:01:30,510 ‫it's going to keep the same public IPv4 34 00:01:30,510 --> 00:01:33,060 ‫so that it can be desirable, but there is a cost to it. 35 00:01:33,060 --> 00:01:36,690 ‫So if you leave it attached to your EC2 instance, 36 00:01:36,690 --> 00:01:38,040 ‫you don't pay for it. 37 00:01:38,040 --> 00:01:41,190 ‫But if your EC2 instance is stopped, 38 00:01:41,190 --> 00:01:46,080 ‫or your elastic IPv4 is not attached to anything, 39 00:01:46,080 --> 00:01:47,940 ‫then you're going to have an ongoing cost 40 00:01:47,940 --> 00:01:52,650 ‫because AWS needs to pay to keep that public IP alive 41 00:01:52,650 --> 00:01:54,360 ‫and within its own network. 42 00:01:54,360 --> 00:01:56,640 ‫So that's why Elastic IP can be beneficial 43 00:01:56,640 --> 00:01:59,160 ‫to have a fixed IPv4 that's public, 44 00:01:59,160 --> 00:02:00,660 ‫but also can cost you some money 45 00:02:00,660 --> 00:02:04,320 ‫if you don't use it or if the EC2 instance is stopped. 46 00:02:04,320 --> 00:02:06,630 ‫Finally, we have IPv6. 47 00:02:06,630 --> 00:02:10,200 ‫So this is the next evolution of the internet protocol, 48 00:02:10,200 --> 00:02:12,430 ‫and I will not name how many addresses that is, 49 00:02:12,430 --> 00:02:14,880 ‫it is a lot of more addresses, 50 00:02:14,880 --> 00:02:18,240 ‫about 3.4 times 10 at the power of 38, 51 00:02:18,240 --> 00:02:20,280 ‫so quite lot addresses. 52 00:02:20,280 --> 00:02:21,840 ‫Each IP is going to be public. 53 00:02:21,840 --> 00:02:25,140 ‫There is no private range and they look like this. 54 00:02:25,140 --> 00:02:27,570 ‫And you can actually enable your VPC 55 00:02:27,570 --> 00:02:29,880 ‫to use IPv6 as well. 56 00:02:29,880 --> 00:02:30,840 ‫So that's it for this lecture. 57 00:02:30,840 --> 00:02:34,083 ‫I hope you liked it and I will see you in the next lecture.