Hi, everyone, and welcome back.
Now, in today's video, we are going to discuss about the routes in Transit Gateway.
Now, when we discuss about routing, one of the important concept that you should be aware of is the
route propagation.
And at a high level overview, when we discuss about VPC attachments with Transit Gateway, the CIDR
block of the VPC are automatically propagated to the transit gateway route table whenever you attach
it.
So let's go ahead and understand this with a simple animation where on the left hand side you have two
VPC and you have the transit gateway here.
Now whenever you attach a VPC, let's say you attach the VPC with a CIDR of one 7216.
So this is the attachment.
A As soon as this VPC attachment completes within the transit gateway route table, an entry is automatically
added with the CIDR block of this and its associated information.
So this is referred to as a propagated route.
Similarly, when you add one more VPC, which is the attachment B, again the entry associated, this
VPC gets added within the transit gateway route table.
And in a similar way, whenever you remove a specific attachment, let's say you remove the VPC number
one attachment, then automatically the route entry associated with it will be removed from the transit
gateway route table.
So with this base set, let's go ahead and look into it practically.
Now, for today's demo, I have a transit gateway that is available.
And for this transit gateway, if you look into the route tables here, let's look into the routes.
There are no route entries that are currently available.
And if you'll also look into the transit gateway attachments, there are no attachments that are currently
available.
So let's do one thing.
Let's go ahead and quickly create an attachment and we'll see on how the entries get propagated.
So I'll just say VPC is zero one attachment.
Will select the transit gateway, and we'll also select one of the VPC.
Here.
Let us go ahead and create a transit gateway attachment in a similar way.
Let's also create one more attachment.
I'll say VPC zero two attachment.
Will select the transit gateway.
Will select one more VPC that I have and I'll click on Create Attachment.
So once the attachment completes, then if you go to the transit gateway route tables, if you look
into the routes at this stage there are no routes because the attachment creation is still in progress.
So let's quickly wait for a moment for the attachment to be available.
Now, if we quickly go to the transit gateway attachment, we see that both of our attachments are now
available.
So now if you go back to the root tables.
If you look into the root, we see that there is one route that is added automatically.
If you look into the route type, it is propagated.
If we refresh one more time, you see again the route associated with the second VPC is also added and
the route type is propagated.
All right.
So I hope with this overview you understood the basics of route propagation now in the transit gateway
route table, along with the propagated routes that we were discussing.
You also have an option to add a static route and this gives us a lot of flexibility.
For example, let's say you want to drop certain amount of traffic from a specific VPC.
This is something that you can do with the static routes as well.
Let's also look into it.
So within the routes you have the option of creating a static route.
So let's say I create a static route for 192 160 800 slash 16.
Now what I want is that any traffic that goes to this VPC should be dropped.
So in such case, I'll just create a black hole and I'll create a static route over here.
Now, before we do that, let's quickly verify if the VPC is are able to communicate between each other.
So let me just copy the IP address of the VPC instance to and from the VPC.
One instance will go ahead and we'll quickly run ping to verify.
So let's quickly do a ping.
I'll paste the IP address and at this stage it is working perfectly well.
Now let's go ahead and add a static route to verify if the traffic gets blocked, so I'll create a static
route.
Now, again, note that it's not always necessary that you use a black hole.
Depending upon the use case, you can select the appropriate option.
So let's say 192 160 800 slash 16.
Any traffic that goes towards this specific destination lets us do a black hole.
All right.
Now, if you look into the routes.
The second one associated with 192 168.
It is now a black hole.
So now if we quickly do a ping from the instance, you see the ping connectivity is now unavailable.
All right.
So I hope with this you understood the basics of static routes as well.
Now, the last pointer is associated with the route evaluation order.
Now within there are two major pointers.
The first pointer is that the most specific route for the destination address is given the higher priority.
This is one part.
Now, in certain cases what will happen is that you have a route entry with the same destination IP
addresses.
Now, which entry will be given?
The priority is something that we need to understand.
So let's say there are two routes with the same set of CIDR blocks.
So in such cases, the priority will always go to the static route.
This is the first part.
Then you have a prefix list reference route, you have the VPC propagated, you have the Gateway propagated,
transit Gateway connect propagate and side to side VPN propagated.
So let's look into it at an overview once more.
Now, one thing that you might have noticed is that as soon as we added a static route over here to
Black Hole, there was one more propagated route that is not really available here.
You see, you do not really see it within the list.
Now, in fact, let's do one thing.
Let's create one more static route for this specific CIDR block, and then we'll see whether the static
route or this takes precedence.
So let's do one thing.
I'll say one 7230 100 16 All right.
So this is the same destination as we are discussing for the routes with the same destination IP addresses,
but different targets.
The route priority as follows.
So let's do one thing.
Let me just say the target is VPC zero two.
The type is active.
I'll create a static route here.
Now, if you look into the route associated with one 7231, you have a static route and the earlier
propagated route that we had is no longer being shown over here.
Now, in case if you remove the static route, let's just delete it.
Automatically.
You see, the propagated root has taken over the higher priority.
Similarly, let's also delete the static root associated with a black hole.
Let's refresh and automatically.
Now you see the propagated route has taken the higher priority.
Great.
So I hope this has also given you much more better clarity related to the root evaluation order.
So with this will conclude today's video.