BGP (Border Gateway Protocol) is a routing protocol specifically designed for routing between autonomous systems (ASes) on the internet. It is essential for both large-scale enterprise networks and service providers.
OPEN:
UPDATE:
KEEPALIVE:
NOTIFICATION:
BGP uses a set of rules to select the best path when multiple routes to the same destination are available. Below are the key criteria:
AS-PATH Length:
AS100 → AS200 → AS300 is preferred over AS100 → AS400 → AS500 → AS300.Weight:
Local Preference:
Other Attributes:
BGP routes include several attributes that influence routing decisions:
Community:
no-export: Do not advertise outside the local AS.no-advertise: Do not advertise to any BGP peer.local-AS: Do not advertise outside the confederation.MED (Multi-Exit Discriminator):
AS-PATH:
Next-Hop:
In standard IBGP deployments, all IBGP-speaking routers must form a full mesh, meaning every IBGP router must peer with every other IBGP router. This is because IBGP does not advertise routes learned from one IBGP peer to another by default.
To overcome this scalability limitation, Junos supports the use of Route Reflectors (RRs).
To scale IBGP networks and avoid full-mesh limitations, Route Reflectors (RRs) are used to relay updates among IBGP peers.
Example Configuration Snippet:
set protocols bgp group RR_CLIENT type internal
set protocols bgp group RR_CLIENT local-as 65001
set protocols bgp group RR_CLIENT neighbor 192.0.2.2 route-reflector-client
Exam Tip:
You might be asked:
“Which BGP feature allows an IBGP speaker to forward routes to other IBGP peers?”
Correct answer: Route Reflector
In Juniper’s implementation of BGP, a received route will not be added to the routing table unless its next-hop IP address is resolvable via the local routing table, typically through IGP protocols like OSPF or IS-IS.
BGP relies on IGPs (like OSPF or IS-IS) to resolve next-hop addresses; routes with unreachable next-hops are considered invalid.
This is true for both IBGP and EBGP routes. Even if a route is valid from a BGP perspective, it is not installed unless the next-hop is reachable.
Exam Tip:
A classic trap question might ask:
“Why is a BGP-learned route not appearing in the routing table?”
Correct answer: Its next-hop address is not reachable via an IGP.
Communities are used to tag routes with metadata and apply policy decisions based on those tags. Common well-known communities include no-export, no-advertise, and internet.
In Junos, community-based routing policies are configured under the policy-options hierarchy.
Example: Match and Apply Community Policy
set policy-options community NO_EXPORT members no-export
set policy-options policy-statement BLOCK_EXPORT term MATCH_COMM {
from community NO_EXPORT
then reject
}
This example creates a named community called NO_EXPORT, matches routes tagged with it, and applies a rejection policy.
Exam Tip:
You might see a config block and be asked:
“What does this policy do to routes with the no-export community?”
Correct answer: Rejects them before advertising to external peers.
Unlike OSPF or IS-IS, BGP does not use Dijkstra's SPF algorithm to build a network topology. Instead, it maintains AS-level path information and uses attributes to choose the best route.
BGP is a path vector protocol, not a link-state protocol, and does not use SPF (Dijkstra).
Core Selection Attributes:
Weight (local, Cisco only)
Local Preference (higher is better)
AS-PATH length (shorter is better)
Origin (IGP < EGP < Incomplete)
MED (lower is better)
EBGP over IBGP
Shortest IGP path to next-hop
Exam Tip:
If you are given a list of protocols and asked which uses Dijkstra’s algorithm, do not pick BGP.
While you may not be asked to write full CLI configurations in JN0-351, you will need to interpret or validate existing config fragments.
Important Commands:
show route protocol bgp
Displays all BGP-learned routes currently in the routing table.
show bgp summary
Shows BGP peer states, number of prefixes received, and session status.
show route receive-protocol bgp <neighbor>
Lists the routes received from a specific peer (regardless of RIB installation).
Configuration Recognition Example:
set protocols bgp group EBGP type external
set protocols bgp group EBGP peer-as 65100
set protocols bgp group EBGP neighbor 203.0.113.1
Exam Tip:
A question might present this configuration and ask whether this is an EBGP or IBGP session based on the peer-as.
| Topic | Key Exam Insight |
|---|---|
| IBGP Full Mesh & RR | Route Reflectors prevent the full-mesh requirement among IBGP peers |
| Next-Hop Reachability | BGP routes are rejected if the next-hop isn’t resolvable via IGP |
| Community Attribute Control | Communities are matched in policy-options and applied via policy-statements |
| Path Selection Logic | BGP uses attributes; it is not link-state and does not use SPF |
| CLI Interpretation | Be able to interpret set protocols bgp group ... and analyze common show cmds |
What attribute is evaluated first during the BGP best-path selection process?
The highest local preference is evaluated first.
When multiple BGP routes exist for the same prefix, routers apply a decision process to determine the best path. The first commonly evaluated attribute is local preference, which indicates the preferred outbound path inside an autonomous system.
Higher local preference values are preferred. Network administrators often modify this value to influence outbound traffic flow between different Internet providers.
Demand Score: 95
Exam Relevance Score: 94
What is the difference between iBGP and eBGP?
iBGP exchanges routes within the same autonomous system, while eBGP exchanges routes between different autonomous systems.
External BGP (eBGP) is used for routing between organizations or service providers. Internal BGP (iBGP) distributes those routes within the same autonomous system.
A key rule in iBGP is the full-mesh requirement, meaning every router must form a BGP session with every other router unless route reflectors are used.
Demand Score: 90
Exam Relevance Score: 92
What is the purpose of the AS-Path attribute?
The AS-Path attribute records the sequence of autonomous systems a route has traversed.
Every time a route passes through an autonomous system, the AS number is appended to the AS-Path attribute.
This attribute provides loop prevention and is also used during route selection. In general, routes with shorter AS-Paths are preferred because they represent shorter paths through the Internet.
Demand Score: 88
Exam Relevance Score: 90
What is a BGP route reflector?
A route reflector allows routers to share iBGP routes without requiring a full mesh.
In large networks, establishing BGP sessions between every router becomes complex. A route reflector reduces this requirement by redistributing routes between client routers.
Clients send routes to the route reflector, which then advertises them to other clients. This design greatly simplifies large enterprise and service-provider networks.
Demand Score: 87
Exam Relevance Score: 90
Why might a BGP route appear in the BGP table but not in the routing table?
Another route may have a better preference or metric.
Routers often learn routes from multiple sources such as OSPF, static routes, and BGP. Even if a BGP route is present in the BGP table, it may not be installed in the routing table if another route has a better preference value.
Troubleshooting requires checking both the BGP table and the main routing table.
Demand Score: 85
Exam Relevance Score: 91
What does the NEXT_HOP attribute indicate in BGP?
It identifies the next router that should receive traffic toward the destination.
The NEXT_HOP attribute specifies the IP address of the router that should be used to reach a specific network. In iBGP deployments, this value often remains unchanged, which may cause reachability issues if routers cannot reach that address.
Administrators frequently configure next-hop self to ensure proper routing.
Demand Score: 84
Exam Relevance Score: 89