Trying to understand routes in routes table

0

I am trying to understand what else I can add to custom route table that I have created for my VPC other than the local route and the internet gateway route (that enable internet traffic to the IGW). I have thought routes are the place to connect the public subnets to the internet gateway. But when I try to do that it gave me an error. So I am looking for an explanation for what I can do with routes in a route table ( I think I am confused with routes in a route table and subnet association in the route table). If somebody can explain this to me would be really grateful.

Thanks.

  • Can you provide an example of your inputs and what error you're getting when you try to configure your route table to route to the IGW? Because this is absolutely the place where you create a route from a subnet to the IGW (thus making it a public subnet).

uspa19
asked a year ago1133 views
1 Answer
0

It sounds like what you are describing is one of the primary use cases for route tables (i.e. creating a route with destination 0.0.0.0/0 and target IGW to make a subnet public). I'd be curious to know what error your are getting (and at what point in the process) when you try to do that. If you want more examples of common types of routes that are configured in a route table there is a page in the Virtual Private Cloud documentation with Example routing options you might find useful.

profile pictureAWS
answered a year ago
  • Thanks for your response, MiguelUT. I have two public subnets in my VPC. And when I was trying to add the CIDR blocks of the two subnets into the routes table as routes (public subnet CIDR block as Destination and internet gateway as the Target, thinking I need to connect the subnet to IGW to make the internet traffic flow to my subnets) I received the following error, "The destination CIDR block is equal to or more specific than one of this VPC's CIDR blocks. This route can target only an interface or an instance.". This is where I thought that my thinking what routes in a route table are wrong, hence seeking an explanation from the community to correct my misunderstanding on routes in routes table.

    UPDATE: In the AWS docs, in this URL, https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html, for routes table, its says, "You can add a route to your route tables that is more specific than the local route. The destination must match the entire IPv4 or IPv6 CIDR block of a subnet in your VPC. The target must be a NAT gateway, network interface, or Gateway Load Balancer endpoint."

    I think this what I took wrong, thinking that I can add subnet CIDR as routes.

  • If you're trying to route out to the internet then you need to route the 0.0.0.0/0 traffic to the IGW -- that's basically saying any traffic not destined for the subnet (or I guess technically any traffic NOT specifically subject to another route in the table) should go to the internet.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions