How to Create & Configure Route Table on Amazon Web Service(AWS).
A route table contains a set of rules, called routes, that are used to determine where network traffic from your subnet or gateway is directed.
The route table contains existing routes with targets other than a network interface, Gateway Load Balancer endpoint, or the default local route. The route table contains existing routes to CIDR blocks outside of the ranges in your VPC. Route propagation is enabled for the route table.
- Login to aws portal.
- Click on Services.
- Under Networking & Content Delivery select VPC.
- Click on Route Tables.
- Click on Create Route Table.
- Provide Route Table tag name.
- Select existing VPC.
- Click on Create Route Table.
- After sometime route table is ready.
- Select Routes.
- Click on Edit Routes.
- Click on Add route.
- Provide Destination & Target.
- Then click on save changes.
- Select Subnet associations.
- Click on Edit Subnet associations.
- Select existing subnets.
- Click on save associations.
Create Route Table using Shell
- Setup aws-cli on your system so click on link https://www.hackerxone.com/blog/how-install-configure-aws-cli-ubuntu-1804
- Run the following command:
To create a route table
aws ec2 create-route-table –vpc-id vpc-id
To create a route
aws ec2 create-route –route-table-id existing-route-table-id –destination-cidr-block 0.0.0.0/0 –gateway-id igw-id
Associate route table to subnet
aws ec2 associate-route-table –route-table-id route-table-id –subnet-id subnet-id