Route table and subnet association

amazon ec2amazon-vpcamazon-web-services

I have a (non-default) VPC created in my account. It has a default routing table entry. I created an internet gateway and added a route table entry for the outgoing traffic to map to the internet gateway I created.

Now when I check the Route Table properties, under Subnet Associations, I see this message (note, I also have a subnet created in the VPC)-

You do not have any subnet associations. The following subnets have
not been explicitly associated with any route tables and are therefore
associated with the main route table:

However, when I go to the subnet listed below this message and check its properties, under "Route Table", it shows the same route table entries. Doesn't that mean that the subnet is associated with the route table I created? And if it is so, what does the message shown above mean? Also, what does the main route table in the message mean?

Thank you for any help on this.

Best Answer

Each subnet must be associated with a route table, which controls the routing for the subnet. If you don't explicitly associate a subnet with a particular route table, the subnet is implicitly associated with the main route table.

https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html

One Route table can be assigned to many subnets, A subnet has one route table.

Change the Subnet association to the NEW route table you created. To associate a route table with a subnet

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route Tables, and then select the route table.

  3. On the Subnet Associations tab, choose Edit.

  4. Select the Associate check box for the subnet to associate with the route table, and then choose Save.

https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html#AssociateSubnet

Related Topic