Are you preparing for a BGP-focused network engineer interview?
Whether you’re a fresher brushing up on the basics or an experienced engineer revising the key concepts — this guide is designed just for you.
In this post, I’ve compiled 50 essential BGP interview questions, each answered in a concise, easy-to-understand format.
The goal?
To give you a quick reference sheet that covers everything you’re likely to be asked — from fundamentals like AS_PATH and iBGP rules to more advanced topics like route reflectors, load balancing, and TTL security.
So once you’ve gone through this list, I encourage you to explore the detailed blogs linked throughout for a richer, hands-on learning experience.
Let’s dive in –
Q1. What is BGP and why is it used?
Border Gateway Protocol (BGP) is a path-vector routing protocol used to exchange routing and reachability information between autonomous systems (AS) on the Internet. It is essential for routing data between large networks such as ISPs, cloud providers, and enterprises.
Why it’s used:
- Enables routing decisions based on policies, not just metrics
- Supports multi-homing and load balancing
- Handles large routing tables with scalability and control
Q2. What’s the difference between iBGP and eBGP?
BGP has two types of peering relationships:
- iBGP (Internal BGP): Established between routers within the same Autonomous System (AS)
- eBGP (External BGP): Established between routers in different ASes
Key differences:
Property | iBGP | eBGP |
---|---|---|
AS Number | Same AS | Different ASes |
AS_PATH | Not modified | Modified on advertisement |
TTL (Default) | 255 | 1 |
Full Mesh | Required (or use RR) | Not required |
Q3. What is an Autonomous System (AS)?
An Autonomous System (AS) is a collection of IP networks and routers that operate under a single administrative entity, such as an Internet Service Provider (ISP), enterprise, or university. These networks share a common and consistent routing policy, which makes them act as a single unit when communicating with other networks on the Internet.
Every Autonomous System is identified by a unique Autonomous System Number (ASN) — a globally recognized identifier assigned by regional Internet registries (RIRs) like APNIC, ARIN, or RIPE NCC.
The ASN plays a critical role in BGP (Border Gateway Protocol), which uses it to:
- Build and maintain routing paths
- Prevent routing loops using the AS_PATH attribute
- Apply policies that influence how data enters and exits the network
There are two types of ASNs:
Private ASNs (used for internal/private networks or MPLS VPN environments)
Public ASNs (used for Internet-facing BGP deployments)
Q4. What are BGP Peering and BGP Neighbors?
BGP peering is the process of forming a neighbor relationship between two BGP-speaking routers. Once a TCP session is established (on port 179), the routers exchange routing information.
Types of peers:
- eBGP Peers: Between routers in different ASes
- iBGP Peers: Within the same AS
Q5. What is the default administrative distance of BGP?
Administrative Distance (AD) defines the trust level of a routing protocol.
- eBGP: AD = 20
- iBGP: AD = 200
A lower AD means higher trustworthiness when multiple protocols learn the same route.
Q6. What is the BGP Path Selection Process?
When multiple routes to the same destination exist, BGP uses a decision-making process to choose the best one.
Selection order:
- Highest Weight (Cisco-specific)
- Highest Local Preference
- Shortest AS_PATH
- Lowest Origin Type (IGP < EGP < Incomplete)
- Lowest MED
- eBGP over iBGP
- Lowest IGP metric to next-hop
- Lowest BGP Router ID
Only one best path is chosen and advertised.
Q7. What are BGP attributes?
BGP attributes are route properties used to evaluate and control routing decisions.
Types of attributes:
- Well-Known Mandatory: AS_PATH, NEXT_HOP, ORIGIN
- Well-Known Discretionary: LOCAL_PREF
- Optional Transitive: COMMUNITY
- Optional Non-Transitive: MED
These attributes enable BGP to implement fine-grained routing policies.
Q8. How does BGP prevent routing loops?
One of BGP’s core responsibilities is to ensure routing loops never occur between Autonomous Systems (ASes) — and it does that using the AS_PATH attribute.
Here’s how it works:
When a route is advertised from one BGP router to another, the advertising router prepends its own ASN to the beginning of the AS_PATH. This means every BGP route carries a record of the ASes it has passed through.
Now, when a BGP router receives a route update, the very first thing it checks is:
Does this AS_PATH contain my own ASN
If the answer is yes, the router knows that this route has already passed through its own AS — which would create a loop if accepted. So, the route is immediately discarded.
Q9. What is AS_PATH Prepending?
AS_PATH prepending is a method of making a path appear longer by repeating your own AS number in the AS_PATH. This influences how external peers prefer alternate routes, commonly used for traffic engineering and controlling inbound traffic.
Example:
Instead of advertising 65001
, you can advertise 65001 65001 65001
to make that path less attractive.
Q10. What is Local Preference in BGP?
Local Preference (LOCAL_PREF) is used to influence outbound traffic within an AS. It is a well-known discretionary attribute.
- Higher LOCAL_PREF = more preferred
- Default is 100 in Cisco routers
- It is shared among all iBGP routers in the same AS
It helps administrators control which exit point traffic uses when leaving the network.
Q11. What is MED (Multi Exit Discriminator) in BGP?
The MED, or Multi Exit Discriminator, is a BGP attribute used to influence how other autonomous systems enter your network.
Imagine you have two links between your AS and another AS. You might prefer one over the other due to bandwidth, latency, or cost. MED gives you a way to signal that preference to your neighbor.
Key facts:
- Lower MED values are preferred
- It’s sent to external BGP peers
- Only compared if routes come from the same AS
Real-world use:
Let’s say your AS is connected to an ISP in both Mumbai and Delhi. You can use MED to suggest that traffic from the ISP enters your AS through Delhi for certain prefixes.
Q12. What are BGP communities?
BGP communities are like tags that you attach to routes so you can apply policies later — kind of like putting a sticky note on a document that says “handle with care.”
They allow you to group routes logically and make decisions based on those groups.
Why use them?
- Easily manage routing policies
- Control advertisement behavior (e.g., no-export)
- Share routing preferences across multiple routers
Examples:
no-export
: Don’t advertise to eBGP peers65001:100
: A custom tag used internally for policy decisions
In practice:
An ISP might tag all customer routes with 65001:200
and apply certain outbound filters or preferences based on that tag.
Q13. What is route filtering in BGP?
Route filtering is BGP’s way of saying,
“I’ll only take or advertise routes that match my rules.”
You can filter:
- What you accept from a neighbor
- What you advertise to them
Methods:
- Prefix lists (filter based on IP prefixes)
- AS-path filters (filter based on origin AS)
- Route-maps (for complex match/set logic)
Why it matters:
Without filtering, you risk route leaks, bogus routes, or even major outages. Filtering is best practice for every BGP deployment.
Q14. What is a route reflector in BGP?
In iBGP, every router must peer with every other — and that doesn’t scale well. That’s where route reflectors come in.
A route reflector (RR) is a router that acts as a central hub, reflecting routes between its clients so they don’t have to peer with each other.
Benefits:
- Reduces number of iBGP sessions
- Simplifies configuration in large networks
- Supports hierarchical BGP designs
Example:
If you have 50 routers in a service provider core, instead of building 1,225 iBGP sessions (50×49/2), you can just configure a few route reflectors. Much simpler.
Q15. What is BGP confederation?
BGP confederation is another tool to solve the iBGP full-mesh problem — but it works a bit differently from route reflectors.
With confederations, you split your large AS into smaller sub-ASes internally. Externally, your AS still appears as a single AS to the outside world.
Why use confederations?
- Reduce iBGP session count
- Retain policy control between internal sub-ASes
- Still follow BGP path rules internally
Think of it as a federation of smaller ASes operating as one team.
Q16. What is the difference between hard reset and soft reset in BGP?
Sometimes you want BGP to re-evaluate routes — maybe after changing a filter or route-map.
Hard Reset:
- Tears down the BGP session
- Forces a full re-learn of all routes
- Interrupts traffic temporarily
Soft Reset:
- Reprocesses routes without disconnecting
- Can be inbound or outbound
- Doesn’t affect live traffic
Best practice: Always use soft reset when possible:
clear ip bgp * soft in
Q17. What is the BGP synchronization rule?
The synchronization rule is a legacy BGP rule that’s mostly disabled today. Here’s the idea behind it:
BGP should not advertise a route to external peers unless that route is also known via an IGP.
This rule existed to prevent black holes in networks that didn’t run iBGP everywhere. Today, with full iBGP deployments and MPLS, this rule is no longer needed.
You disable it with:
no synchronization
And you should.
Q18. What is the use of the next-hop-self
command in BGP?
When a router receives a route from an eBGP peer, it passes that route to its iBGP neighbors — but keeps the original next-hop IP.
This can break things if those iBGP routers don’t know how to reach that next-hop.
The fix: Use next-hop-self
to rewrite the next-hop to your own IP:
neighbor 10.0.0.2 next-hop-self
This ensures next-hop reachability for downstream routers.
Q19. Can a BGP router advertise a route it didn’t originate?
Yes — but with some rules.
A BGP router can advertise:
- eBGP-learned routes to iBGP peers
- iBGP-learned routes to eBGP peers
But:
A router can’t advertise iBGP-learned routes to another iBGP peer — unless it’s a route reflector.
This rule prevents loops and is a key reason full mesh (or RRs) is needed in iBGP.
Q20. What is the default BGP TTL, and why does it matter?
- eBGP peers use a default TTL of 1, which means they must be directly connected
- iBGP peers use a TTL of 255
If you’re running eBGP between routers that aren’t directly connected (like via loopbacks), you need to allow for more hops:
neighbor x.x.x.x ebgp-multihop 5
This ensures BGP sessions form successfully over intermediate hops.
Q21. Why is iBGP full mesh required?
In BGP, there’s a very specific rule:
A router that learns a route via iBGP cannot advertise it to another iBGP peer.
Why? To prevent loops within the AS.
But this leads to a major design requirement: every iBGP router must form a full mesh with every other iBGP router to ensure complete route visibility.
In a small network: no problem.
In a large AS with 50+ routers? Full mesh is unmanageable.
Solutions:
- Use Route Reflectors to reflect routes between iBGP peers
- Use Confederations to break the AS into manageable subgroups
Q22. What is BGP route dampening?
Route dampening is a stability feature in BGP that suppresses flapping routes — routes that go up and down frequently.
Each time a route flaps, BGP applies a penalty. When the penalty crosses a threshold, the route is temporarily suppressed (not advertised).
After some time, the penalty decays, and the route is re-advertised.
Why use it?
- Prevents instability in global routing
- Reduces CPU load on routers
- Helps maintain cleaner BGP tables
Q23. What is the BGP router ID?
The BGP router ID is a 32-bit identifier that uniquely identifies a BGP speaker in the AS.
It doesn’t need to be routable — it just needs to be unique.
Selection order:
- Manually configured with
bgp router-id
- Highest IP on a loopback interface
- Highest IP of any active interface
Tip: It’s best practice to manually configure the router ID so it’s predictable and consistent across reboots.
Q24. What happens when BGP receives a route with its own AS in the AS_PATH?
This is BGP’s built-in loop prevention mechanism.
If a router sees its own ASN in the AS_PATH of a received route, it discards that route.
Why?
It means the route has looped back into your AS — and that’s something you never want.
This check is simple but very effective at keeping routing sane across the Internet.
Q25. Can BGP use static routes?
Yes, absolutely.
BGP itself doesn’t create routes — it advertises them. If you have a static route and want to share it with BGP neighbors, just redistribute it or use the network
command.
Example:
ip route 10.1.1.0 255.255.255.0 Null0
router bgp 65001
network 10.1.1.0 mask 255.255.255.0
The static route must exist in the RIB (routing table), or BGP won’t advertise it.
Q26. How does BGP handle multiple paths to the same prefix?
By default, BGP installs only one best path into the routing table — even if it learns multiple paths to the same prefix.
But here’s the good part:
You can configure BGP to use multiple equal paths by enabling Multipath using:
maximum-paths <number>
Conditions for Multipath:
- All key attributes (LOCAL_PREF, AS_PATH, MED, etc.) must match
- Supported in both eBGP and iBGP (platform dependent)
Useful when:
- You want to load-balance across ISPs
- You’re using dual-homed designs
Q27. Can BGP support load balancing?
Yes — but with some conditions.
Unlike IGPs like OSPF or EIGRP, BGP is policy-driven and only advertises one best path by default. For load balancing to work:
- Paths must be equal-cost (AS_PATH, MED, LOCAL_PREF, etc.)
maximum-paths
must be set- Platform must support BGP ECMP
Keep in mind:
Even when multiple paths are used, only one will be advertised to peers unless explicitly configured.
Q28. What is the difference between LOCAL_PREF and MED?
Attribute | Scope | Preference Rule | Used for |
---|---|---|---|
LOCAL_PREF | Within AS | Higher is better | Outbound traffic |
MED | Between ASes | Lower is better | Inbound traffic |
Use LOCAL_PREF when:
You want to control which ISP or exit point your traffic uses to leave your network.
Use MED when:
You want to influence how other ASes enter your network.
Both are valuable tools in BGP traffic engineering — they just work in different directions.
Q29. What is BGP split-horizon behavior?
This refers to the rule that:
A route learned from one iBGP peer cannot be advertised to another iBGP peer.
Why? To prevent routing loops.
This is known as iBGP split-horizon, and it’s why full mesh, route reflectors, or confederations are required in iBGP deployments.
In contrast, eBGP doesn’t have this restriction.
Q30. What is ORIGIN in BGP, and what types does it have?
The ORIGIN attribute shows how a route entered BGP in the first place.
There are three possible values:
- IGP (i) – Injected using the
network
command - EGP (e) – Learned via the now obsolete Exterior Gateway Protocol
- Incomplete (?) – Redistributed from another protocol (like static or OSPF)
Preference rule:
IGP < EGP < Incomplete
So, IGP is most preferred, incomplete is least.
Why it matters:
When all other attributes are equal, BGP looks at ORIGIN to break the tie.
Q31. What is the difference between BGP aggregate and summary routes?
Great question! These terms are often used interchangeably, but in BGP, “aggregate” has a specific meaning.
- A summary route is a general networking concept — combining multiple subnets into one (like
10.0.0.0/8
for10.1.0.0/16
,10.2.0.0/16
, etc.). - A BGP aggregate route is created using the
aggregate-address
command.
BGP aggregation adds options:
- You can suppress specific routes
- You can attach attributes like
as-set
orsummary-only
Example:
aggregate-address 10.0.0.0 255.0.0.0 summary-only
This tells BGP: “Advertise only the summarized prefix and suppress the rest.”
Q32. What does the summary-only
keyword do in BGP aggregation?
The summary-only
keyword is like a filter that hides the more specific routes.
By default, when you configure an aggregate route, BGP still advertises the specific component prefixes. If you don’t want that, you add summary-only
.
Without it:
BGP advertises both the summary and the more specific routes.
With it:
Only the summary (aggregate) route is advertised.
It’s useful when you want to keep your advertised routes clean, simple, and prevent leaking internal prefixes to the Internet.
Q33. What is the use of the as-set
option in BGP aggregation?
When you aggregate routes in BGP, by default, the new summarized route does not carry any AS_PATH history. This can cause confusion or even loop risks in downstream ASes.
That’s where as-set
helps.
It includes all AS numbers from the original component routes in the AS_PATH — wrapped in curly braces like {65001 65002}
.
Why use it?
- Prevents routing loops
- Maintains some AS transparency
- Helps with policy control in remote ASes
Think of as-set
as a breadcrumb trail for aggregated routes.
Q34. What is the difference between Idle and Active BGP states?
BGP peering goes through several states: Idle → Connect → Active → OpenSent → OpenConfirm → Established
Idle:
The router is waiting to initiate the TCP session.
Active:
The router is trying to connect, but the session hasn’t formed yet.
If your session is stuck in Active, it’s a sign something’s wrong:
- No IP connectivity
- Wrong AS number
- TCP port 179 blocked
- Misconfigured neighbor statement
You want your session to reach Established — that’s when routes are exchanged.
Q35. What is BGP Graceful Restart?
Graceful Restart is like BGP’s “don’t panic” button.
It lets a router retain forwarding information even if the control plane (BGP process) restarts.
Here’s how it works:
- When a router restarts, its peers don’t immediately flush the routes.
- The peer waits for the BGP session to come back up.
- If it does within the timer window, no route loss occurs.
Why it matters:
- Prevents unnecessary route flaps
- Increases stability in HA environments
- Supports non-disruptive maintenance
Note: Both routers must support and agree to Graceful Restart.
Q36. What is a route-map in BGP and how is it used?
A route-map in BGP is like a policy engine. It lets you:
- Match routes based on conditions (prefix, AS_PATH, communities, etc.)
- Set attributes (like LOCAL_PREF, MED, or next-hop)
- Filter or tag routes
Example use cases:
- Set LOCAL_PREF to prefer one path
- Prepend AS_PATH to de-prioritize a route
- Drop specific prefixes from being advertised
Syntax (simple example):
route-map SET_PREF permit 10
match ip address 1
set local-preference 200
Route-maps make BGP programmable and policy-driven.
Q37. What is the maximum number of BGP paths supported in Cisco routers?
It depends on the platform and IOS version.
Common support:
- Cisco IOS/IOS-XE: Supports up to 6 eBGP paths (with
maximum-paths
) - IOS XR: Can support up to 64 or more
- NX-OS: ECMP also supported with multiple paths
Command:
router bgp 65001
maximum-paths 4
But remember, all selected paths must have identical attributes, or they won’t qualify for ECMP.
Q38. Can a route-map be applied to both inbound and outbound BGP updates?
Yes, and in fact, it’s a common practice.
- Inbound route-map: Controls what you accept from your peer
- Outbound route-map: Controls what you advertise to your peer
Example:
neighbor 10.0.0.2 route-map IN_FILTER in
neighbor 10.0.0.2 route-map OUT_POLICY out
This allows you to:
- Modify LOCAL_PREF, MED, or next-hop
- Filter specific prefixes
- Apply communities
Using both directions gives you full control of your BGP policies.
Q39. What is BGP TTL Security (GTSM)?
GTSM (Generalized TTL Security Mechanism) is a security feature used to protect eBGP sessions from spoofing or DoS attacks.
How it works:
- Normal eBGP sessions have a TTL of 1 (directly connected)
- GTSM expects the incoming BGP packet to have TTL = 255
- The router checks the TTL and drops any packet with TTL lower than expected
Configuration:
neighbor 10.0.0.2 ttl-security hops 1
This makes it extremely hard for an attacker from a non-directly connected host to spoof BGP packets.
Q40. What is the use of BGP peer groups or templates?
In large-scale BGP deployments (think ISPs or data centers), many BGP peers share the same configuration.
Instead of copying and pasting config repeatedly, you can use:
- Peer groups (legacy method)
- Peer templates (modern, flexible)
Benefits:
- Consistency
- Easier updates
- Less risk of configuration errors
Example:
neighbor EBGP_GROUP peer-group
neighbor EBGP_GROUP remote-as 65050
neighbor 192.0.2.1 peer-group EBGP_GROUP
Templates are especially helpful when managing dozens or hundreds of BGP peers.
Q41. Why might a BGP session fail to establish?
This is a very common interview — and real-world — question.
When a BGP session stays stuck in the Idle or Active state, here’s what you should check:
Possible causes:
- IP connectivity not working (try
ping
ortraceroute
) - TCP port 179 blocked by ACL or firewall
- AS number mismatch between neighbors
- Incorrect neighbor IP address
- TTL expired (for eBGP, default TTL is 1)
- Duplicate BGP sessions for the same peer
Troubleshooting steps:
- Use
show ip bgp summary
- Run
debug ip bgp
(carefully, in lab or low traffic) - Verify configs on both ends match exactly
Q42. What does the network
command do in BGP?
In BGP, the network
command tells the router which prefix to advertise — but only if that route is already present in the routing table.
Syntax:
network 192.168.10.0 mask 255.255.255.0
Important note:
Unlike in IGPs, the network
command in BGP does not generate a route — it only advertises an existing one.
If the exact prefix isn’t present in the RIB, BGP won’t advertise it.
Q43. What is the next-hop issue in iBGP and how is it resolved?
When a route is learned via eBGP and advertised to an iBGP peer, the next-hop IP is not changed by default.
This can cause reachability issues if the iBGP router doesn’t know how to get to that next-hop.
Solution:
Use next-hop-self
so the advertising router replaces the next-hop with its own IP.
Example:
neighbor 10.0.0.2 next-hop-self
This ensures all iBGP routers have a reachable next-hop, avoiding black-holing.
Q44. What is the difference between weight and LOCAL_PREF in BGP?
These are both BGP attributes used to influence outbound path selection — but they operate differently.
Attribute | Scope | Default | Preference Rule |
---|---|---|---|
Weight | Local router only | 0 (Cisco) | Higher is better |
LOCAL_PREF | Entire AS | 100 | Higher is better |
- Weight is Cisco-specific and not shared between routers
- LOCAL_PREF is shared among all iBGP peers
Use weight for local override, and LOCAL_PREF for network-wide decisions.
Q45. Can BGP run over loopback interfaces?
Yes — and in fact, many network engineers prefer this.
Why use loopbacks?
- They remain up as long as the router is up
- Provide more stability
- Useful in iBGP and eBGP over multi-hop scenarios
Required commands:
neighbor 10.1.1.1 update-source loopback0
neighbor 10.1.1.1 ebgp-multihop 2
This tells BGP to use the loopback as the source, and to accept TTL greater than 1 for eBGP.
Q46. What are the BGP message types?
There are four BGP message types:
- OPEN: Initializes the session
- KEEPALIVE: Maintains the session (sent every 60 seconds)
- UPDATE: Advertises or withdraws routes
- NOTIFICATION: Used to report errors and terminate the session
Most of the action in BGP happens through the UPDATE messages.
Q47. What is the use of the local-as
command in BGP?
local-as
allows a router to pretend to belong to a different AS when talking to external peers.
Why use it?
- During mergers or transitions between AS numbers
- When acting as a middleman (like MPLS provider edge routers)
- To maintain backward compatibility with peer expectations
Example:
neighbor 10.0.0.2 local-as 65010
You can also add no-prepend
or replace-as
for more control over AS_PATH appearance.
Q48. How do you view the BGP routing table?
Use these commands to inspect BGP information on a Cisco router:
show ip bgp
– View the global BGP tableshow ip bgp summary
– Check neighbor statusshow ip bgp neighbors x.x.x.x received-routes
– View what was receivedshow ip bgp neighbors x.x.x.x advertised-routes
– View what was sent
Also useful:
show ip bgp x.x.x.x
– View specific prefix detailsdebug ip bgp
– Real-time troubleshooting (use with care)
Q49. Can a router belong to multiple BGP ASes?
Yes, it can — depending on how you design the BGP architecture.
Ways to do this:
- Using
local-as
to appear as another AS to specific neighbors - Configuring BGP confederations, where internal sub-ASes exist
- Managing multiple VRFs or instances with different ASNs
This is especially common in:
- MPLS PE routers
- ISPs transitioning between ASNs
- Hybrid routing environments
Q50. What are best practices for BGP configuration?
Security:
- Use MD5 authentication on BGP sessions
- Enable TTL security (GTSM) for eBGP
- Filter prefixes with prefix-lists or route-maps
Stability:
- Avoid unnecessary redistribution
- Set
max-prefix
to protect memory - Use route dampening for flapping routes
Scalability:
- Use peer groups or templates
- Deploy route reflectors or confederations
- Summarize routes wherever possible
Monitoring:
- Log neighbor changes
- Monitor prefix count
- Use SNMP or NetFlow for traffic behavior
These practices help ensure your BGP deployment is resilient, secure, and scalable.
Let’s Connect
Have you enjoyed this BGP interview prep guide?
If you found this post useful:
- Feel free to share it with a friend or colleague
- Leave a comment or question below — I’d love to hear from you.
Thanks for reading — and best of luck in your interview!