AWS VPC Route Tables

- aws networking

This post is part of my note taking while studying for the AWS Certified Advanced Networking - Specialty certification.

VPC route tables instruct hosts in VPC subnets how to reach other hosts. The default route is the local route, allowing all VPC subnets to communicate to all other VPC subnets. A best practice is to have separate route tables for each subnet, which allows fine-grained routing controls within a VPC.

Here is a UI representation of a subnet routing table. As you can see, the 192.168.201.0/24 is the VPC network, the default route is toward a NAT Gateway and there is route to an on-prem network via a VGW.
VPC subnet routing table

Here is a CLI representation fo the same routing table:

C:>aws ec2 describe-route-tables –route-table-id rtb-04254262

{
    "RouteTables": [
        {
            "Associations": [
                {
                    "SubnetId": "subnet-9c669fa0",
                    "RouteTableAssociationId": "rtbassoc-a11564d8",
                    "Main": false,
                    "RouteTableId": "rtb-04254262"
                },
                {
                    "SubnetId": "subnet-01945b5a",
                    "RouteTableAssociationId": "rtbassoc-cb0d6cb2",
                    "Main": false,
                    "RouteTableId": "rtb-04254262"
                },
                {
                    "SubnetId": "subnet-b0c60e9d",
                    "RouteTableAssociationId": "rtbassoc-a42957dd",
                    "Main": false,
                    "RouteTableId": "rtb-04254262"
                },
                {
                    "RouteTableAssociationId": "rtbassoc-b70798ce",
                    "Main": true,
                    "RouteTableId": "rtb-04254262"
                }
            ],
            "RouteTableId": "rtb-04254262",
            "VpcId": "vpc-5c1a213b",
            "PropagatingVgws": [
                {
                    "GatewayId": "vgw-24866f4d"
                },
                {
                    "GatewayId": "vgw-be9c75d7"
                }
            ],
            "Tags": [],
            "Routes": [
                {
                    "GatewayId": "local",
                    "DestinationCidrBlock": "192.168.201.0/24",
                    "State": "active",
                    "Origin": "CreateRouteTable"
                },
                {
                    "Origin": "CreateRoute",
                    "DestinationCidrBlock": "0.0.0.0/0",
                    "NatGatewayId": "nat-017bf70e32eb635bd",
                    "State": "active"
                },
                {
                    "GatewayId": "vgw-be9c75d7",
                    "DestinationCidrBlock": "10.129.32.0/20",
                    "State": "active",
                    "Origin": "EnableVgwRoutePropagation"
                }
            ]
        }
    ]
}