Route Tables
2 minute read
In AWS, a route table is a set of rules, called routes, that determine where network traffic is directed. Every subnet in a VPC must be associated with a route table, which controls the traffic routing for that subnet. When you launch a new subnet in a VPC, you can either use the default route table or create a new one.
Route tables contain one or more routes, each of which specifies a destination CIDR block and a target. The destination CIDR block is the range of IP addresses for which the route applies, and the target is the destination for traffic matching that route.
There are several types of targets that you can specify in a route, including:
Internet Gateway (IGW): A gateway that provides a connection between your VPC and the internet. You can create a route that directs traffic to an IGW to allow resources in your VPC to communicate with the internet.
Virtual Private Gateway (VGW): A VPN concentrator on the AWS side of a VPN connection. You can create a route that directs traffic to a VGW to allow resources in your VPC to communicate with a remote network over a VPN connection.
NAT Gateway: A managed gateway that allows resources in your private subnets to access the internet while still blocking incoming traffic from the internet. You can create a route that directs traffic to a NAT gateway to provide internet access for resources in your private subnets.
Network Interface: A network interface attached to an instance in your VPC. You can create a route that directs traffic to a specific instance in your VPC by specifying the network interface ID.
By configuring the routes in your route table, you can control how traffic flows between subnets in your VPC, between your VPC and the internet, and between your VPC and other networks. You can also use route tables to create more complex network topologies, such as multiple VPCs connected by peering or VPN connections.