How to Configure User-Defined Routes in AWS

In Amazon Web Services (AWS), creating User-Defined Routes (UDRs) is a crucial networking task that allows you to customize the routing behavior for specific subnets within your Virtual Private Cloud (VPC). UDRs offer flexibility and control, enabling you to design a more efficient, secure, and scalable network environment. In this guide, I will walk you through the steps to create UDRs in AWS cloud and explain each step.

Each subnet is associated with a route table containing rules (routes) for directing traffic. By default, a VPC has a main route table, but custom route tables can be created for more specific control.

Related: How to Create/Modify NACLs and SGs in AWS

Configuring user defined routes (UDR) in AWS Step-by-Step

Step 1: Plan your network architecture

Consider traffic patterns, security needs, and performance requirements.

List the UDRs that you need for your application. 

Step 2: Navigating to the AWS management console

Log in to your AWS account and access the AWS Management Console.

Type “VPC” on the search bar and click on VPC.

Screenshot showing accessing the AWS VPC

Step 3: Creating VPC and subnet

You need to have a VPC created and a Subnet to add the UDRs.

Here I have the “Test VPC” which is attached to an Internet Gateway.

Screenshot showing list of AWS VPCs that I have created

I also have created a subnet named “test-subnet” in which we will be adding the UDRs.

Step 4: Creating the route tables section

Click on “Route Tables” in the left-hand navigation pane.

Then click on “Create Route Table.”

Screenshot showing accessing and creating route table in AWS

Provide a name and select the VPC for the association.

Screenshot showing creating route table in AWS

Then click on “Create route table.”

The route table will be created. 

Screenshot showing AWS route table created

Step 5: Associating subnets with the UDR

Click on the “Subnet Associations” section.

Then click “Edit subnet associations.”

Screenshot showing the subnet association on the AWS route table.

You will see the list of available subnets.

Select the subnets that require the UDR by ticking the checkboxes next to each subnet.

Click “Save associations” to associate the subnets with the route table.

Screenshot showing me associating the subnet with the AWS route table.

Step 6: Adding custom routes to the UDR

Go to the “Routes” section of the UDR details page and click “Edit routes.”

Screenshot showing me editing the AWS route table.

You will see the “Designation”, and “Target”. 

Screenshot showing me configuring the user-defined routes on the route table.

For this demo, we will be configuring a route to the internet:

Destination: 0.0.0.0/0 (all IPv4 addresses)
Target: Internet Gateway (IGW)

This route allows instances in the subnet associated with the route table to access the internet.

(If you want to know more about the different UDRs, Designations, and Targets. Scroll down to the last section of this tutorial.)

In the “Designation” type “0.0.0.0/0” and target as “Internet Gateway.” It will display the internet gateway attached to your VPC. Select that internet gateway.

Screenshot showing me adding the internet gateway route

(If you don’t see the Internet gateway list after you have selected the “Internet Gateway” then you might not have