AWS Default Routing


Course Introduction
VPC Fundamentals
What is a VPC?
PREVIEW16m 20s
VPC Security and Control
VPC Connectivity
Introduction to AWS PrivateLink
VPC Sharing using the AWS Resource Access Manager
Understanding Direct Connect, Implementation and Configuration
Why Direct Connect?
5m 25s
Understanding AWS Direct Connect - Connectivity Options
7m 3s
Examining AWS Routing
AWS Default Routing

The course is part of this learning path

AWS Default Routing
3h 55m

This section of the AWS Certified Solutions Architect - Professional learning path introduces you to the core networking concepts and services relevant to the SAP-C02 exam. We start with an introduction to the AWS Virtual Private Network (VPC) and networking services. We then understand the options available and learn how to select and apply AWS networking, DNS, and content delivery services to meet specific design scenarios relevant to the AWS Certified Solutions Architect - Professional exam. 

Want more? Try a Lab Playground or do a Lab Challenge

Learning Objectives

  • Get a foundational understanding of VPCs, their security, and connectivity
  • Learn about VPC sharing using the AWS Resource Access Manager
  • Discover inter-regional and intra-regional communication patterns in AWS
  • Learn about AWS Direct Connect, along with its implementation, configuration, and connectivity options
  • Understand routing in AWS, including static and dynamic routing
  • Understand the basics of networking, including Elastic IP addresses, Elastic Network Interfaces, networking with EC2, VPC endpoints, and AWS Global Accelerator
  • Learn about the DNS and content delivery services Amazon Route 53 and Amazon CloudFront

In this lecture, we will discuss VPC default routing. When you create a VPC, an implicit route is created for you. You cannot see this router but it's there. This route is connected to each VPC subnet and address by using the first IP address of each subnet. We interact with router by using route tables. When created each VPC has a default route table. This route table will contain targets identified as local. Here you can see an example of this. The local target is used for all packages going through the router that the destination address matched by the entry. is the IPv4 CIDR block assigned to our VPC from which all the VPC subnets will obtain their address ranges. The local entry cannot be altered and it cannot be deleted. This local entry means that EC2 instances deployed to different subnets in the same VPC will be able to route to each other. But what if EC2 instances want to be able to route the Internet?

How will that affect our route tables? To allow instances in public subnets who also have public IP addresses to route traffic to the internet, we need to request an Internet gateway for our VPC and adjust the route table to route traffic through the internet gateway. Here is an example of what the route table would look like when configured to use an Internet gateway. Here we can see that we have added a default IPv4 route of that sends traffic to the Internet gateway. An Internet gateway must be requested attached to VPC in order for it to appear as a target in our route table. Now, any traffic matching will be sent locally, everything else will be sent through the Internet gateway. But what about IPv6? Well, IPv6 works in the same way. Here's an example of route in IPv6 and route in IPv6 traffic through an Internet gateway. To allow instances in private subnets who only have private IP addresses to access the Internet, we typically use a NAT gateway. The NAT gateway is deployed to a public subnet, so that it can use the Internet gateway to access the Internet. We then create a new route table, associate the private subnets with a new route table, and add a route that route's Internet traffic through the NAT gateway.

This is how the route table might look. Here we see the default route, but this time traffic that matches is sent to target NAT gateway. This is the NAT gateway deployed to a public subnet. We have then used the subnet associations tab and explicitly associated our private subnets with the route table. Subnets can only be associated with one route table at a time. So, by associating the private subnets with this route table, we are removing their associations with the default route table. In every VPC, one route table it designated the main route table. This is the route table that all new subnets are associated with. 

Because of this and to reduce the chances of new subnets being given access to routes that they shouldn't be able to use, it is recommended that main route table only contains the local route. Route in IPv6 traffic the Internet from a private subnet works slightly differently than IPv4. IPv6 traffic from a private subnet is routed through an egress-only Internet gateway. Egress-only internet gateways work just like a NAT gateway, but for IPv6 traffic instead of IP version 4. You request an egress-only Internet gateway in the same way you request an Internet gateway and you attach it to your VPC. You then edit a route table to use it. Here's an example of a route table configured to use an egress-only Internet gateway.


About the Author
Learning Paths

Danny has over 20 years of IT experience as a software developer, cloud engineer, and technical trainer. After attending a conference on cloud computing in 2009, he knew he wanted to build his career around what was still a very new, emerging technology at the time — and share this transformational knowledge with others. He has spoken to IT professional audiences at local, regional, and national user groups and conferences. He has delivered in-person classroom and virtual training, interactive webinars, and authored video training courses covering many different technologies, including Amazon Web Services. He currently has six active AWS certifications, including certifications at the Professional and Specialty level.