{"id":4911,"date":"2026-02-21T15:02:48","date_gmt":"2026-02-21T15:02:48","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4911"},"modified":"2026-02-21T15:02:48","modified_gmt":"2026-02-21T15:02:48","slug":"bgp-test-lab-part-6-bgp-attributes-path-selection-med-and-local-preference","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4911","title":{"rendered":"BGP Test Lab &#8211; Part 6 &#8211; BGP Attributes, Path Selection: MED and Local Preference"},"content":{"rendered":"\n<p>Border Gateway Protocol (BGP) path selection works out the best path when BGP has routes that it could choose from. There are a number of BGP Attributes which are evaluated (top to bottom) so that the path with the best attribute is selected for the path.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-BGPAttributes\">BGP Attributes<\/h1>\n\n\n\n<p>There are 11 BGP Attributes, these are used by BGP to determine the &#8220;best path&#8221;. We&#8217;re not going to go into detail here about them, that will come in a later article; however we&#8217;re going to quickly review these so you can see what they are, then we&#8217;ll explore in this article how two of them, MED and Local Preference can be used.<\/p>\n\n\n\n<p>The key thing to remember is that each attribute has a priority from lowest to highest. When BGP attempts to determine the best path, it goes through the list from top to bottom. If there is a tie, for example you have two possible paths to the same network each with the same&nbsp;<strong>Weight<\/strong>, BGP just moves to the next attribute to see if it can determine the best path from the two it has learned.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>Priority<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\"><strong>Attribute<\/strong><\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">1<\/td><td class=\"has-text-align-left\" data-align=\"left\">Weight<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">2<\/td><td class=\"has-text-align-left\" data-align=\"left\">Local Preference (LPref)<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">3<\/td><td class=\"has-text-align-left\" data-align=\"left\">Originate<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">4<\/td><td class=\"has-text-align-left\" data-align=\"left\">AS path length<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">5<\/td><td class=\"has-text-align-left\" data-align=\"left\">Origin code<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">6<\/td><td class=\"has-text-align-left\" data-align=\"left\">MED (Multi Exit Discrimator)<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">7<\/td><td class=\"has-text-align-left\" data-align=\"left\">eBGP&nbsp;path over&nbsp;iBGP&nbsp;path<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">8<\/td><td class=\"has-text-align-left\" data-align=\"left\">Shortest IGP path to BGP next hop<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">9<\/td><td class=\"has-text-align-left\" data-align=\"left\">Oldest path<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">10<\/td><td class=\"has-text-align-left\" data-align=\"left\">Router ID<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">11<\/td><td class=\"has-text-align-left\" data-align=\"left\">Neighbour IP address<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-CurrentNetworkTopology\">Current Network Topology<\/h1>\n\n\n\n<p>We have the topology from the previous article. Nothing has really changed, but what we have done is stated that we want the link between Router A and Router C to be the &#8220;backup&#8221; path. And we want the link between Router B and Router D to be the &#8220;primary&#8221; path.<\/p>\n\n\n\n<p>Currently, however if you were to ping from Router G to the Router H (or vice versa) you&#8217;d find that it would favour the &#8220;BACKUP PATH&#8221;, in this article we&#8217;re going to explore techniques to influence and control this routing path to how we want it to work.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"823\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-31.png\" alt=\"\" class=\"wp-image-4912\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-31.png 793w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-31-289x300.png 289w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-31-768x797.png 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-WhydoesitfavourtheRouterAside?(withnospecificmechanismtoinfluence)\">Why does it favour the Router A side? (with no specific mechanism to influence)<\/h1>\n\n\n\n<p>Although we&#8217;ll deep dive into the BGP Attributes in a later article, what we have found is that the network appears to favour the &#8220;BACKUP PATH&#8221; (Router A \u2194 Router C) for some reason. We&#8217;ve not yet implemented any kind of techniques to influence or direct traffic in any particular way, so clearly it is using an attribute to determine the &#8220;best path&#8221; as between Router A and Router C rather than between Router B and Router D.<\/p>\n\n\n\n<p>Let&#8217;s have a look on Router G.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"344\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-32.png\" alt=\"\" class=\"wp-image-4913\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-32.png 729w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-32-300x142.png 300w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"367\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-33.png\" alt=\"\" class=\"wp-image-4914\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-33.png 512w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-33-300x215.png 300w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/figure>\n\n\n\n<p>OK, so we&#8217;re interested in the route to 10.2.2.0\/24 which is hosted on Router G. Let&#8217;s step down all the attributes and see if we can figure out how it&#8217;s making its decision. So stepping through the list above one by one from the top (first one used to determine):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Weight<\/strong> &#8211; In this case both the routes have the same weight, value of 1, so that&#8217;s a tie, moving on&#8230;<\/li>\n\n\n\n<li><strong>Local Preference<\/strong> &#8211; Both have the same 100 (we&#8217;ve not set this), so that&#8217;s a tie, moving on&#8230;<\/li>\n\n\n\n<li><strong>Originate <\/strong>&#8211; Neither of the routes have come from (been installed by) this local router (i.e. Router G), so that&#8217;s also a tie, moving on&#8230;<\/li>\n\n\n\n<li><strong>AS Path Length<\/strong> &#8211; Both paths have only one AS-Path AS listed (65002), so that&#8217;s a tie, moving on&#8230;<\/li>\n\n\n\n<li><strong>Origin Code<\/strong> &#8211; A bit of a weird one (and more detail in an upcoming article), but in this case these have been learned via IGP (rather than EGP), IGP is preferred over EGP, and EGP is preferred over INCOMPLETE. In this case they are both &#8220;i&#8221; (IGP), so that&#8217;s also a tie, moving on&#8230;<\/li>\n\n\n\n<li><strong>MED <\/strong>&#8211; The MED value (which we&#8217;ll show in use later) is 0 for both too, so that&#8217;s a tie, moving on&#8230;<\/li>\n\n\n\n<li><strong>Oldest Path<\/strong> &#8211; The Oldest Path is a very odd one, it doesn&#8217;t appear to work the way you&#8217;d expect. Firstly, it appears that it only applies to routes learned via eBGP, not via iBGP, in our case on Router G, it is only learning routes via eBGP, thus it appears this is just not used to determine anything. Secondly, during testing, we&#8217;ve proven that this attribute isn&#8217;t used (for Router G), because otherwise the route\/path would stick on Router B \u2194 Router D link, if the Router A \u2194 Router C link were to fail and then return; but that is not what happens, it just immediately changes the most desirable (best) path back to the one via Router A \u2194 Router C, so a further assertion that it &#8220;prefers the current&#8221; rather than &#8220;prefers the oldest&#8221; might hold for eBGP (not tested), but doesn&#8217;t hold for iBGP which was tested here. Link: <a href=\"https:\/\/www.practicalnetworking.net\/stand-alone\/bgp-oldest-path\/\">bgp-oldest-path<\/a> &#8211; Ergo, this isn&#8217;t being used, so moving on&#8230;<\/li>\n\n\n\n<li><strong>Router ID<\/strong> &#8211; The Router ID, means the path (from or via) the BGP neighbour router with the lowest Router ID. So in this case the route (path) coming from Router ID 1.1.1.1 (Router A) is lower than the route (path) coming from Router ID 1.1.1.2 (Router B), so this looks to be why Router G is picking the route (path) via Router A \u2194 Router C over the other path via Router B \u2194 Router D. So this appears to be the deciding attribute, although at this point the evaluation would stop, let&#8217;s discuss the last one.<\/li>\n\n\n\n<li><strong>Neigbour\/Neighbor IP Address <\/strong>&#8211; Similar to the evaluation of the lowest Router ID attribute (above), the path that has the lowest neighbour IP address would be preferred, if in this case it were to have been used, the Router A \u2194 Router C link would have one being 192.168.100.8\/30, so 192.168.100.10 at the Router C end (the &#8220;next-hop&#8221;) from the point of view of Router G. As another bit of information, if we were to have two links between Router A and Router C, the Router ID would be the decider.<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Path Selection<\/h1>\n\n\n\n<p>There are a number of different options for path selection, the key thing to remember is it is influence rather than command. You don&#8217;t own the remote Autonomous System (AS) so we can only attempt to influence the best path selection within their network, they are the owners of it though! We&#8217;ll look into these three approaches to see how they work; there are more, but these are the more commonly used ones I&#8217;ve seen in use.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>MED Multi Exit Discriminator<\/li>\n\n\n\n<li>AS Path Prepending<\/li>\n\n\n\n<li>BGP Communities<\/li>\n<\/ol>\n\n\n\n<p>So what do we actually want to do? What is the goal?<\/p>\n\n\n\n<p>Well, as we found the traffic going between Router G&#8217;s RouterG-LAN1 (10.1.2.0\/24) and Router H&#8217;s RouterH-LAN1 (10.2.2.0\/24) could take a route via Router A or a route via Router B when going from AS Blue 65001 to AS Green 65002. We found it appeared to favour the Router A path (unless that link was unavailable), but what if we wanted it to always use the path via Router B instead? i.e. How can we manipulate (influence) what is the primary, and what is the secondary?&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Multi Exit Discriminator (MED)<\/h2>\n\n\n\n<p>So by default the route from Router G to Router H seems to go via Router A, let&#8217;s make it use the route via Router B as the primary, and then the route via Router A as the secondary.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"844\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-34.png\" alt=\"\" class=\"wp-image-4915\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-34.png 775w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-34-275x300.png 275w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-34-768x836.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-RouterA\">Router A<\/h2>\n\n\n\n<p>We want Router A to be the backup route, so give this a higher MED (metric) value.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>edit policy BACKUPROUTE-OUT<\/code><\/pre>\n\n\n\n<p>Then add the following content, we are specifying the exact routes\/networks we want to have the MED manipulated on. There is also a catch-all, so any other routes will be transmitted, without the MED value changed. If you don&#8217;t add the catch-all the routes won&#8217;t be transmitted at all; which may or may not be what you want, in our case that is not what we want!<\/p>\n\n\n\n<p>You&#8217;ll also notice we&#8217;re using the&nbsp;supernet&nbsp;for the AS Blue, summarised to 10.1.0.0\/16, this is just so we can ensure that any new routes we might add are also included, without us needing to go back and add it manually to this policy.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>entry BACKUPROUTE-OUT {\nif match any {\n\u00a0 \u00a0 \u00a0 \u00a0 nlri 10.1.0.0\/16;\n}\nthen {\n        med add 100;\n\t\tpermit;\n}\n}\nentry BACKUPROUTEOUT-ALL {\nif match any {\n}\nthen {\n        permit;\n}\n}<\/code><\/pre>\n\n\n\n<p>Check the policy is okay with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>check policy BACKUPROUTE-OUT<\/code><\/pre>\n\n\n\n<p>Then apply it to the BGP Neighbour (peer) configuration between Router A and Router C.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>configure bgp neighbor 192.168.100.10 route-policy out BACKUPROUTE-OUT<\/code><\/pre>\n\n\n\n<p>Refresh it with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>refresh policy BACKUPROUTE-OUT<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-RouterB\">Router B<\/h2>\n\n\n\n<p>Now, ideally you&#8217;d also add a policy for the MED on Router B, i.e. your second entry\/exit point to the AS, but for brevity and clarity we are not. However, if you were, you&#8217;d be setting a lower MED, say 50, so the receiving router D in this case, is attempted to be influenced to use this as the preferred ingress point. Whereby with MED the lower the value the more preferable the route.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-LocalPreference\">Local Preference<\/h1>\n\n\n\n<p>Also required is a local preference to ensure that the paths are symmetrical.<\/p>\n\n\n\n<p>We can illustrate this by looking at the route tables of Router G and Router H, we should be able to track the same path of intermediate routers between them in each direction, but if we have a look we can see this is not the case.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Router G&#8217;s path between RouterG-LAN1 (10.1.2.0\/24) is: Router G \u2192 Router A \u2192 Router C \u2192 Router H.<\/li>\n\n\n\n<li>Router H&#8217;s path to RouterG-LAN1 (10.1.2.0\/24) is: Router H \u2192 Router D &#8211; Router B \u2192 Router G.<\/li>\n<\/ul>\n\n\n\n<p>That&#8217;s not what we want, although asymmetric routing can sometimes be useful, we want our path to be more deterministic through the network, in the current situation the traffic going between Router G and Router H (and vice-versa) would take one path outbound leg and another on the inbound leg.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-RouterG(ASBlue)\">Router G (AS Blue)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>* tris-routerG.2 # show bgp routes all\n\nRoutes:\n     Destination         Peer            Next-Hop        LPref Weight MED        AS-Path\n----------------------------------------------------------------------------------------\n*>i  10.1.0.0\/24         1.1.1.1         1.1.1.1         100   1      0\n*>i  10.1.1.0\/24         1.1.1.2         1.1.1.2         100   1      0\n*>i  10.2.0.0\/24         1.1.1.1         192.168.100.10  100   1      0          65002\n  i  10.2.0.0\/24         1.1.1.2         192.168.100.14  100   1      0          65002\n*>i  10.2.1.0\/24         1.1.1.1         192.168.100.10  100   1      0          65002\n  i  10.2.1.0\/24         1.1.1.2         192.168.100.14  100   1      0          65002\n*>i  10.2.2.0\/24         1.1.1.1         192.168.100.10  100   1      0          65002\n  i  10.2.2.0\/24         1.1.1.2         192.168.100.14  100   1      0          65002\n\nFlags: (*) Preferred BGP route, (>) Active, (d) Suppressed, (h) History\n       (s) Stale, (m) Multipath, (u) Unfeasible\n\nOrigin: (?) Incomplete, (e) EGP, (i) IGP<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Router H (AS Green)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>* tris-routerH.3 # show bgp routes all\n\nRoutes:\n     Destination         Peer            Next-Hop        LPref Weight MED        AS-Path\n----------------------------------------------------------------------------------------\n*>i  10.1.0.0\/24         1.1.1.4         192.168.100.13  100   1      0          65001\n*>i  10.1.1.0\/24         1.1.1.4         192.168.100.13  100   1      0          65001\n*>i  10.1.2.0\/24         1.1.1.4         192.168.100.13  100   1      0          65001\n*>i  10.2.0.0\/24         1.1.1.3         1.1.1.3         100   1      0\n*>i  10.2.1.0\/24         1.1.1.4         1.1.1.4         100   1      0\n\nFlags: (*) Preferred BGP route, (>) Active, (d) Suppressed, (h) History\n       (s) Stale, (m) Multipath, (u) Unfeasible\n\nOrigin: (?) Incomplete, (e) EGP, (i) IGP\n<\/code><\/pre>\n\n\n\n<p>To correct this we can use the &#8220;Local Preference&#8221; to dictate how traffic will leave (egress) an AS.<\/p>\n\n\n\n<p>Where using the MED attempts to influence another AS for ingress to an AS, the Local Preference can be used to dictate within an AS how traffic will egress an AS.<\/p>\n\n\n\n<p>In our example we want that the Router A \u2194 Router C link is a backup and the Router B \u2194 Router D link is the primary, so we&#8217;ll add a policy on the Router A \u2194 Router C BGP Neighbour, specifically on the Router A side (AS Blue) as an inbound policy, which will lower the Local Preference, so this route looks less appealing than the route (paths) via Router D; that way we should have a symmetric path outbound and inbound.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-RouterA-Configuration\">Router A &#8211; Configuration<\/h2>\n\n\n\n<p>Create a new policy as follows and apply on the inbound to the BGP Neighbour (peer).<\/p>\n\n\n\n<p>You&#8217;ll also notice we&#8217;re using the&nbsp;supernet&nbsp;for the AS Green, summarised to 10.2.0.0\/16, this is just so if the administrator of AS Green were to add any new networks, we&#8217;d not need to add them manually to the policy. Of course, you may not always be able to do this, but this is where communication between the administrators of each AS becomes important to ensure each other&#8217;s configurations &#8220;dovetail&#8221; as much as possible.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>entry BACKUPROUTE-IN {\nif match all {\n    nlri 10.2.0.0\/16 ;\n}\nthen {\n    local-preference 50 ;   \n    permit  ;\n}\n}<\/code><\/pre>\n\n\n\n<p>Then apply it to the BGP Neighbour (peer) configuration between Router A and Router C.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>configure bgp neighbor 192.168.100.10 route-policy in BACKUPROUTE-IN<\/code><\/pre>\n\n\n\n<p>You may need to refresh with:&nbsp;<strong>&#8220;<em>refresh policy&nbsp;BACKUPROUTE-IN&#8221;<\/em><\/strong>, but now if we examine the route table on Router A, we can indeed see that the routes being learned from Router C now have a Local Preference (LPref) applied to them.<\/p>\n\n\n\n<p>In this case the higher the preference the more favourable the route\/path, the lower the preference the less favourable the route\/path.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>* tris-routerA.13 # show bgp routes all\n\nRoutes:\n     Destination         Peer            Next-Hop        LPref Weight MED        AS-Path\n----------------------------------------------------------------------------------------\n*>i  10.1.1.0\/24         1.1.1.2         1.1.1.2         100   1      0\n*>i  10.1.2.0\/24         1.1.1.7         1.1.1.7         100   1      0\n*>i  10.2.0.0\/24         1.1.1.2         192.168.100.14  100   1      0          65002\n  i  10.2.0.0\/24         192.168.100.10  192.168.100.10  50    1      0          65002\n*>i  10.2.1.0\/24         1.1.1.2         192.168.100.14  100   1      0          65002\n  i  10.2.1.0\/24         192.168.100.10  192.168.100.10  50    1      0          65002\n*>i  10.2.2.0\/24         1.1.1.2         192.168.100.14  100   1      0          65002\n  i  10.2.2.0\/24         192.168.100.10  192.168.100.10  50    1      0          65002\n\nFlags: (*) Preferred BGP route, (>) Active, (d) Suppressed, (h) History\n       (s) Stale, (m) Multipath, (u) Unfeasible\n\nOrigin: (?) Incomplete, (e) EGP, (i) IGP<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-Verify\">Verify<\/h2>\n\n\n\n<p>Okay, so now when we re-examine Router G and Router H&#8217;s route tables what do we now see?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"288\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-35.png\" alt=\"\" class=\"wp-image-4916\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-35.png 719w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-35-300x120.png 300w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"280\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-36.png\" alt=\"\" class=\"wp-image-4917\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-36.png 724w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2026\/02\/image-36-300x116.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/figure>\n\n\n\n<p>As we can now see Router G and Router H are both showing the same path between themselves, which means we now have symmetric routing in place, using Local Preference to direct egress traffic from AS Blue (65001) to use the link Router C \u2194 Router D and then using MED to influence traffic to use the Router C \u2194 Router D link when&nbsp;ingressing&nbsp;into AS Blue (65001), from AS Green (65002) in this case.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-Conclusion\">Conclusion<\/h1>\n\n\n\n<p>We&#8217;ve seen how MED can be used to attempt to influence the other AS to use the entry point to our network we want others to use. Additionally, we&#8217;ve looked at how Local Preference can be used within our own network to control the routing in association with MED to ensure a symmetric routing path.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"BGPTestLabPart6BGPAttributes,PathSelection:MEDandLocalPreference-AdditionalInformation\">Additional Information<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/networklessons.com\/bgp\/bgp-attributes-and-path-selection\">https:\/\/networklessons.com\/bgp\/bgp-attributes-and-path-selection<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.catchpoint.com\/bgp-monitoring\/bgp-med\">https:\/\/www.catchpoint.com\/bgp-monitoring\/bgp-med<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/extreme-networks.my.site.com\/ExtrArticleDetail?an=000080848\">https:\/\/extreme-networks.my.site.com\/ExtrArticleDetail?an=000080848<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Border Gateway Protocol (BGP) path selection works out the best path when BGP has routes that it could choose from. There are a number of BGP Attributes which are evaluated (top to bottom) so that the path with the best attribute is selected for the path. BGP Attributes There are 11 BGP Attributes, these are &#8230; <a title=\"BGP Test Lab &#8211; Part 6 &#8211; BGP Attributes, Path Selection: MED and Local Preference\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4911\" aria-label=\"Read more about BGP Test Lab &#8211; Part 6 &#8211; BGP Attributes, Path Selection: MED and Local Preference\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4783,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,17],"tags":[],"class_list":["post-4911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bgp","category-networking"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4911"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4911\/revisions"}],"predecessor-version":[{"id":4918,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4911\/revisions\/4918"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4783"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}