Home > Blog > CompTIA CompTIA Network+ Certification Exam > BGP Path Attributes: Weight, Local Pref, and MED

BGP Path Attributes: Weight, Local Pref, and MED

Deep Dive Cert Sensei Team 2038-10-29 10 min read

BGP path attributes are properties used by the Border Gateway Protocol to select the best path among multiple candidates. Key attributes include Weight and Local Preference for controlling outbound traffic, and MED (Multi-Exit Discriminator) and AS-Path length for influencing inbound traffic, following a strict hierarchical decision process.

#BGP #CompTIA Network+ #Routing Protocols #N10-009 #Path Attributes

What is the BGP Best Path Selection Process?

Unlike OSPF or EIGRP, which rely on simple metrics like cost or bandwidth, BGP is a policy-based protocol. It doesn't just look for the 'fastest' link; it looks for the path that aligns with the network administrator's business goals. When a BGP router receives multiple routes to the same destination, it runs them through a rigorous tie-breaking algorithm known as the BGP Decision Process.

For the CompTIA Network+ N10-009 exam, you need to understand that this process is hierarchical. The router evaluates attributes one by one; as soon as one attribute provides a clear winner, the process stops, and that path is installed in the routing table. If the first attribute is a tie, it moves to the second, and so on. Understanding this order is the difference between a network that behaves predictably and one that sends your traffic on a scenic tour of the internet.

How do Weight and Local Preference Control Outbound Traffic?

When you want to control how traffic leaves your network, you look at Weight and Local Preference. Weight is a Cisco-proprietary attribute that is local to the router. It is not advertised to any peers. If you have two different links to two different ISPs on a single router, setting a higher Weight on one link forces that router to prefer it. Remember: Higher Weight wins.

Local Preference (Local Pref), on the other hand, is a standard attribute shared among all routers within your own Autonomous System (AS). If you have multiple border routers, Local Pref tells the entire AS which exit point to use. For example, if you prefer your 10Gbps link over a 1Gbps backup link, you would set a higher Local Pref on the 10Gbps path. Again, higher is better. The key distinction is scope: Weight is for a single router, while Local Pref is for the entire AS.

Why is AS-Path Length a Critical Tiebreaker?

If Weight and Local Preference are equal, BGP looks at the AS-Path length. The AS-Path is essentially a list of every Autonomous System the route has passed through. BGP operates on a simple logic here: the shorter the list, the shorter the path. A route that traverses two ASNs is generally preferred over one that traverses five.

In the real world, engineers often use a technique called 'AS-Path Prepending' to influence inbound traffic. By artificially adding their own AS number multiple times to a route advertisement, they make a path look longer and less attractive to the rest of the internet. This is a blunt but effective tool for steering traffic away from a primary link during maintenance or to discourage the use of a costly backup circuit.

What is MED and How Does it Influence Inbound Traffic?

While Local Pref controls how you leave, the Multi-Exit Discriminator (MED) is used to suggest how external traffic should enter your network. MED is sent to an adjacent AS to tell them, 'If you have multiple ways to get into my network, please use this one.' Unlike Weight and Local Pref, MED follows the 'lower is better' rule. A lower MED value is more preferred.

It is important to note that MED is only relevant when you have multiple entry points into the same neighboring AS. If you are dealing with two different ISPs, they will likely ignore your MED values in favor of their own Local Preference settings. This is a common point of confusion on the Network+ exam: remember that you can suggest a path via MED, but the neighboring AS always has the final say based on their own internal policies.

In What Order Does BGP Evaluate These Attributes?

To master BGP, you must memorize the hierarchy. The simplified order is: Weight (Highest) $\rightarrow$ Local Preference (Highest) $\rightarrow$ Locally Originated $\rightarrow$ AS-Path (Shortest) $\rightarrow$ Origin Type $\rightarrow$ MED (Lowest). If the process reaches the end of the list without a winner, it resorts to tie-breakers like the oldest route or the lowest Router ID.

Getting these sequences mixed up is a common reason students miss points in the routing domain. This is why we've built 1,000 expert-curated practice questions for the CompTIA Network+ (N10-009) at Cert Sensei. By using our domain-level analytics, you can see exactly where your knowledge of BGP logic is failing and drill down into those specific areas with detailed expert reasoning for every single answer.

How Do You Apply These Concepts in Real-World Scenarios?

Imagine you are managing a corporate network with two ISPs. ISP A is high-speed fiber, and ISP B is a slower satellite link. To ensure all your employees use the fiber for internet access, you would set a higher Local Preference on the routes received from ISP A. This ensures every router in your building knows to exit via ISP A.

Now, imagine you want ISP A to send traffic to your web servers via a specific firewall cluster. You would advertise your server prefix to ISP A with a low MED value on the link connected to that firewall. While ISP A might override this with their own policies, the MED serves as the primary signal for their routers to choose the most efficient entry point into your infrastructure.

❓ Frequently Asked Questions

If both Weight and Local Preference are configured, which one wins?

Weight always wins. In the BGP decision process, Weight is evaluated first. If a router has a route with a higher Weight, it will select that path regardless of what the Local Preference is set to.


Does MED affect traffic leaving my network?

No. MED is used to influence inbound traffic from an adjacent Autonomous System. To control outbound traffic, you should use Weight or Local Preference.


Why would I use AS-Path prepending instead of MED?

MED is often ignored or stripped by ISPs because it only influences the immediate neighbor. AS-Path prepending is seen by every AS along the path, making it a more powerful tool for influencing global inbound traffic.

More from CompTIA CompTIA Network+ Certification Exam

🧠

Test Your Knowledge

Ready to practice CompTIA Network+ Certification Exam? Put what you've learned to the test.

Try 10 Free Questions

⭐ 1,000 expert-curated questions available with Premium

Upgrade Premium
📖 Browse the Glossary

Join thousands of certification students

Sign Up Free