<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Direct Connect on Colin Barker</title>
        <link>https://colinbarker.me.uk/tags/direct-connect/</link>
        <description>Recent content in Direct Connect on Colin Barker</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-gb</language>
        <lastBuildDate>Mon, 21 Oct 2024 14:52:00 +0000</lastBuildDate><atom:link href="https://colinbarker.me.uk/tags/direct-connect/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>AWS Direct Connect Allowed Prefix lists - My &#34;gotchas&#34; with it!</title>
        <link>https://colinbarker.me.uk/blog/2024-10-21-aws-direct-connect-allowed-prefix-lists/</link>
        <pubDate>Mon, 21 Oct 2024 14:52:00 +0000</pubDate>
        
        <guid>https://colinbarker.me.uk/blog/2024-10-21-aws-direct-connect-allowed-prefix-lists/</guid>
        <description>&lt;img src="https://static.colinbarker.me.uk/img/blog/2024/10/jan-huber-4MDXq_aqHY4-unsplash.jpg" alt="Featured image of post AWS Direct Connect Allowed Prefix lists - My &#34;gotchas&#34; with it!" /&gt;&lt;blockquote&gt;
&lt;p&gt;Header photo by &lt;a class=&#34;link&#34; href=&#34;https://unsplash.com/@jan_huber?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Jan Huber&lt;/a&gt; on &lt;a class=&#34;link&#34; href=&#34;https://unsplash.com/photos/silhouette-of-trees-during-sunset-4MDXq_aqHY4?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Unsplash&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;what-is-aws-direct-connect&#34;&gt;What is AWS Direct Connect?
&lt;/h2&gt;&lt;p&gt;In this world of cloud technologies, and the idea that the cloud can solve all your problems, there is always a need to have some level of connection from an on-premise, or data centre location into AWS. Typically, the use of a VPN can be enough for most organisations, and it is a lot cheaper than &lt;a class=&#34;link&#34; href=&#34;https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/aws-direct-connect.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;AWS Direct Connect&lt;/a&gt; however, there will always be a wider security policy, or additional protections you need on your network. This is where AWS Direct Connect comes in.&lt;/p&gt;
&lt;p&gt;Unlike a VPN connection, which creates a private, encrypted tunnel between different networks and AWS, AWS Direct Connect can be seen in the most simplest terms, as plugging a network cable from a switch in your racks into a switch inside AWS that is connected directly into an AWS network. A &lt;a class=&#34;link&#34; href=&#34;https://en.wikipedia.org/wiki/Data_link_layer&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;layer 2&lt;/a&gt; &amp;ldquo;wired&amp;rdquo; connection that you can push traffic you need through it. The connection never transits through the public internet, and is completely private (to a degree). It can reduce the number of hops over different internet routers to get to your AWS network, reducing the latency and improving the available bandwidth to and from your AWS resources, and depending on the size of the pipe you request from AWS, it could be faster than what is currently capable over a standard Site to Site VPN connection.&lt;/p&gt;
&lt;p&gt;It uses a networking standard called &lt;a class=&#34;link&#34; href=&#34;https://en.wikipedia.org/wiki/IEEE_802.1Q&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;802.1Q&lt;/a&gt; VLAN tagging to be able to segment the traffic, by tagging traffic that transverses the network, switches can ensure that only the right ports see the right traffic. This is a very similar concept to the &lt;a class=&#34;link&#34; href=&#34;https://en.wikipedia.org/wiki/Virtual_local_area_network&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;VLANs&lt;/a&gt; that you may be familiar with from your home network, same technology, just in a different context.&lt;/p&gt;
&lt;p&gt;This post isn&amp;rsquo;t meant to be a complete re-hash of the documentation! If you would like to know more, then feel free to look at the &lt;a class=&#34;link&#34; href=&#34;https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/aws-direct-connect.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;AWS Direct Connect documentation&lt;/a&gt;. Instead, I will go through some of the gotchas that I have encountered with AWS Direct Connect while building a network for a customer.&lt;/p&gt;
&lt;h2 id=&#34;allowed-prefixes-for-aws-direct-connect-gateways&#34;&gt;Allowed Prefixes for AWS Direct Connect gateways
&lt;/h2&gt;&lt;p&gt;There is a whole page on the AWS documentation called &lt;a class=&#34;link&#34; href=&#34;https://docs.aws.amazon.com/directconnect/latest/UserGuide/allowed-to-prefixes.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Allowed prefixes interactions&lt;/a&gt; specifically for this, so I will talk about the specific gotcha that I encountered. The allowed prefixes act differently depending on the type of association you have linked your AWS network up to Direct Connect with. Virtual Private Gateway (VPG) or Transit Gateway (TGW), the list changes from a filter to a whitelist of what can be advertised over Direct Connect, and in the case I worked with, in both directions.&lt;/p&gt;



  
    
    
    
  
  
  
  
  
  
  
  &lt;figure&gt;
    &lt;a data-fancybox=&#34;gallery&#34; href=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/DirectConnectBlogPost-Simple-Diagram.jpg&#34; data-caption=&#34;Example of an AWS Direct Connect connection between a Transit Gateway and a Virtual Private Gateway&#34;&gt;&lt;img src=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/DirectConnectBlogPost-Simple-Diagram.jpg&#34;&gt;&lt;/a&gt;
    &lt;figcaption&gt;Example of an AWS Direct Connect connection between a Transit Gateway and a Virtual Private Gateway&lt;/figcaption&gt;
  &lt;/figure&gt;


&lt;p&gt;Firstly, this is just an example of a wider customer example! It wasn&amp;rsquo;t quite set up this way, but this is summarised to show the potential of two different ways to connect your network to AWS. In reality, the customer did have something similar setup, but connected to two different types of setup, that we came in to resolve for them. For this we shall look at the Allowed Prefixes list across both association types.&lt;/p&gt;
&lt;h2 id=&#34;where-to-find-the-allowed-prefixes-list&#34;&gt;Where to find the Allowed Prefixes list
&lt;/h2&gt;&lt;p&gt;This one caught me out when looking around the interface, if you have never had to use AWS Direct Connect before, while you know it might exist from training, locating the list took a few minutes to find! On many occasions during customer calls I got myself lost looking for this, mainly because - it&amp;rsquo;s available in two locations!&lt;/p&gt;



  
    
    
    
  
  
  
  
  
  
  
  &lt;figure&gt;
    &lt;a data-fancybox=&#34;gallery&#34; href=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/direct-connect-gateway-1.png&#34; data-caption=&#34;Location of the Allowed Prefixes from the Direct Connection Gateways UI&#34;&gt;&lt;img src=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/direct-connect-gateway-1.png&#34;&gt;&lt;/a&gt;
    &lt;figcaption&gt;Location of the Allowed Prefixes from the Direct Connection Gateways UI&lt;/figcaption&gt;
  &lt;/figure&gt;





  
    
    
    
  
  
  
  
  
  
  
  &lt;figure&gt;
    &lt;a data-fancybox=&#34;gallery&#34; href=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/direct-connect-gateway-2.png&#34; data-caption=&#34;Location of the Allowed Prefixes from the Transit Gateways UI&#34;&gt;&lt;img src=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/direct-connect-gateway-2.png&#34;&gt;&lt;/a&gt;
    &lt;figcaption&gt;Location of the Allowed Prefixes from the Transit Gateways UI&lt;/figcaption&gt;
  &lt;/figure&gt;


&lt;p&gt;Both locations will send you to the same place, so don&amp;rsquo;t worry that you are editing one and need to amend the other.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Just like with any other BGP connection, making a change to this list will reset the BGP connection and re-advertise the prefixes in the list. This normally isn&amp;rsquo;t an issue, but sometimes this can cause a connectivity break if there is an issue somewhere else in the BGP sessions that exist. Just be aware of this if you need to make a change. Include it in any change request, or process you have to amend the list.&lt;/p&gt;
&lt;h2 id=&#34;an-example-setup&#34;&gt;An example setup
&lt;/h2&gt;


  
    
    
    
  
  
  
  
  
  
  
  &lt;figure&gt;
    &lt;a data-fancybox=&#34;gallery&#34; href=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/DirectConnectBlogPost-Networking-Example.jpg&#34; data-caption=&#34;Simple example of two different groups of CIDRs, can we work out what will be advertised on site?&#34;&gt;&lt;img src=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/DirectConnectBlogPost-Networking-Example.jpg&#34;&gt;&lt;/a&gt;
    &lt;figcaption&gt;Simple example of two different groups of CIDRs, can we work out what will be advertised on site?&lt;/figcaption&gt;
  &lt;/figure&gt;


&lt;p&gt;In this example, we have listed essentially what the VPC&amp;rsquo;s are advertising into the different associations. This hasn&amp;rsquo;t covered the lower level examples of how this connects in, we shall assume that prorogation has been enabled properly on each, and both the Transit Gateway and the Virtual Private Gateway are receiving the correct prefixes.&lt;/p&gt;
&lt;h2 id=&#34;allowed-prefixes-list-with-a-transit-gateway-association&#34;&gt;Allowed Prefixes list with a Transit Gateway Association
&lt;/h2&gt;&lt;p&gt;Starting with an AWS Transit Gateway association, we had traffic being advertised over BGP to AWS, and the VPC&amp;rsquo;s being pushed back through to on-premise. We would need to be able to advertise network from the VPC connections, and On-Premise networks into the Transit Gateway. Remember, that essentially Direct Connect is one &amp;ldquo;router&amp;rdquo; and the Transit Gateway is another, linked with a &amp;ldquo;virtual cable&amp;rdquo;. The allowed prefix list in this case acts as both a filter and an announcer right in the middle of the two, but controlled from the Direct Connect side. This list acts as the CIDR&amp;rsquo;s that get advertised into the Transit Gateway. The &lt;a class=&#34;link&#34; href=&#34;https://docs.aws.amazon.com/directconnect/latest/UserGuide/allowed-to-prefixes.html#allowed-to-prefixes-transit-gateway&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;documentation calls it out&lt;/a&gt; on this specific section, but it caught me out with my customer!&lt;/p&gt;
&lt;p&gt;For this example, we are going to use an allowed prefix list that looks like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;10.0.0.0/16&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;172.26.0.0/20&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;192.168.0.0/20&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;100.70.0.0/24&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this prefix list and the above listed AWS advertised prefixes, this will show you what gets advertised on to the on-premise network. This works the opposite way around as well, for on-premise networks advertised into AWS however, for this example we will just go one way.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;AWS Advertised Prefix&lt;/th&gt;
&lt;th&gt;Allowed Prefix Entry&lt;/th&gt;
&lt;th&gt;On-Premise Received Prefix&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10.0.0.0/16&lt;/td&gt;
&lt;td&gt;10.0.0.0/16&lt;/td&gt;
&lt;td&gt;10.0.0.0/16&lt;/td&gt;
&lt;td&gt;Simple example, what was advertised is what was received&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;172.26.0.0/16&lt;/td&gt;
&lt;td&gt;172.26.0.0/20&lt;/td&gt;
&lt;td&gt;172.26.0.0/20&lt;/td&gt;
&lt;td&gt;Here we have a larger CIDR in AWS, but the prefix is smaller in the allowed prefix list, so the &lt;strong&gt;smaller&lt;/strong&gt; prefix is what is received&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;192.168.0.0/24&lt;/td&gt;
&lt;td&gt;192.168.0.0/20&lt;/td&gt;
&lt;td&gt;192.168.0.0/20&lt;/td&gt;
&lt;td&gt;Here we have a smaller CIDR in AWS, but the prefix is larger in the allowed prefix list, so the &lt;strong&gt;larger&lt;/strong&gt; prefix is what is received&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100.64.0.0/24&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;An example of the filter element working, while we have configured the AWS side to advertise the prefix, it is not allowed to be advertised over Direct Connect to on-premise&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;100.70.0.0/24&lt;/td&gt;
&lt;td&gt;100.70.0.0/24&lt;/td&gt;
&lt;td&gt;This is where it can get a little complex, we have added the allowed prefix, but it isn&amp;rsquo;t being advertised on AWS -or- on premise. In this instance both sides of the association will &lt;strong&gt;receive&lt;/strong&gt; the prefix, even though there is no network&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;GOTCHA&lt;/strong&gt;: Be careful when using the allowed prefix list with a Transit Gateway association, not to try and open up wider CIDR ranges than you need to, as this can have an unindented effect on the traffic that is advertised into the Transit Gateway and on premise.&lt;/p&gt;
&lt;h2 id=&#34;allowed-prefixes-list-with-a-virtual-private-gateway-association&#34;&gt;Allowed Prefixes list with a Virtual Private Gateway Association
&lt;/h2&gt;&lt;p&gt;Moving onto the Virtual Private Gateway association, this connection uses pure filtering. If you are on the filter list, then you will be allowed to advertise, if you are not, then you can&amp;rsquo;t. The CIDRs advertised must be exact otherwise the filter will block it. This list will not actively announce any CIDR in the list, so you can&amp;rsquo;t use it to advertise non-existent or wider ranges to make &amp;ldquo;administration&amp;rdquo; easier later on! The &lt;a class=&#34;link&#34; href=&#34;https://docs.aws.amazon.com/directconnect/latest/UserGuide/allowed-to-prefixes.html#allowed-to-prefixes-virtual-private-gateway&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;AWS Documentation also calls this out&lt;/a&gt; but for me, this is where I was also caught out.&lt;/p&gt;
&lt;p&gt;For this example, we are going to use an allowed prefix list that looks like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;10.100.0.0/24&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;172.16.0.0/20&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;192.168.0.0/20&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this prefix list and the advertised routes that exist in the AWS side, we will show you what gets advertised on the on-premise network. Just like before, this works the opposite way around as well, for on-premise networks advertised into AWS however, for this example we will just go one way.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;AWS Advertised Prefix&lt;/th&gt;
&lt;th&gt;Allowed Prefix Entry&lt;/th&gt;
&lt;th&gt;On-Premise Received Prefix&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10.100.0.0/24&lt;/td&gt;
&lt;td&gt;10.100.0.0/24&lt;/td&gt;
&lt;td&gt;10.100.0.0/24&lt;/td&gt;
&lt;td&gt;Simple example, what was advertised is what was received, filter is allowed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;172.16.0.0/16&lt;/td&gt;
&lt;td&gt;172.16.0.0/20&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;We h ave a wider CIDR in AWS, but the filter is of a smaller range, therefore this does not get advertised into the on-premise network&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;192.168.20.0/24&lt;/td&gt;
&lt;td&gt;192.168.16.0/20&lt;/td&gt;
&lt;td&gt;192.168.20.0/24&lt;/td&gt;
&lt;td&gt;Here we have a smaller CIDR in AWS, and the filter is for a wider range, as the smaller prefix is within the larger prefix on the filter list, it will allow it through to the on-premise network&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100.74.0.0/24&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Simple example, this CIDR is not in th prefix list, so it is not allowed to be advertised&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;GOTCHA&lt;/strong&gt;: Here we can see that the filter list is not the same as before, different ranges get advertised in different ways. While this is talked a lot in the AWS documentation, getting the experience of using this with AWS Direct Connect is a little harder due to it&amp;rsquo;s specific usage and adoption within different customers.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;


  
    
    
    
  
  
  
  
  
  
  
  &lt;figure&gt;
    &lt;a data-fancybox=&#34;gallery&#34; href=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/DirectConnectBlogPost-Prefix-Lists.jpg&#34; data-caption=&#34;The final outcome of what would be received by the Customer Gateway&#34;&gt;&lt;img src=&#34;https://static.colinbarker.me.uk/img/blog/2024/10/DirectConnectBlogPost-Prefix-Lists.jpg&#34;&gt;&lt;/a&gt;
    &lt;figcaption&gt;The final outcome of what would be received by the Customer Gateway&lt;/figcaption&gt;
  &lt;/figure&gt;


&lt;p&gt;Sometimes it can feel counter intuitive on how the two types of allowed prefix lists work, but they are important in knowing the best way to configure a large organisations connection into AWS. Being able to see this in person is very hard to see due to the adoption of AWS Direct Connect, so keep this in mind the next time you run into an odd routing problem with the use of AWS Direct Connect.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
