Wednesday, April 15, 2026

BGP basic configuration using Juniper JUNOS routers

 In Juniper's Junos OS, the configuration is more hierarchical and modular than Cisco's IOS. Instead of placing all commands under a single process, you typically define BGP under the protocols hierarchy.

Here is an example of a basic EBGP setup between two Juniper routers.

Network Topology

  • Router 1 (AS 100): Interface ge-0/0/0.0 with IP 1.1.1.1/30

  • Router 2 (AS 200): Interface ge-0/0/0.0 with IP 1.1.1.2/30


1. Router 1 Configuration (AS 100)

In Junos, you must set the Autonomous System number under routing-options and then configure the BGP group.

Code snippet
[edit]
# Set the Local AS
set routing-options autonomous-system 100
# Create a BGP Group and Peer
set protocols bgp group EXTERNAL-PEERS type external
set protocols bgp group EXTERNAL-PEERS neighbor 1.1.1.2 peer-as 200
# Exporting a route (Junos requires a policy to advertise networks)
set policy-options policy-statement ADVERTISE-LOCAL term 1 from route-filter 10.10.10.0/24 exact
set policy-options policy-statement ADVERTISE-LOCAL term 1 then accept
set protocols bgp group EXTERNAL-PEERS export ADVERTISE-LOCAL

Note: Unlike Cisco, Juniper does not advertise anything by default. You must create an export policy to announce your routes to a BGP neighbor.


2. Router 2 Configuration (AS 200)

Code snippet
[edit]
set routing-options autonomous-system 200
set protocols bgp group TO-R1 type external
set protocols bgp group TO-R1 neighbor 1.1.1.1 peer-as 100
# Optional: Add export policy here if R2 needs to advertise networks back.

3. Comparison of Key Differences

FeatureCisco IOSJuniper Junos
AS Configurationrouter bgp [AS]set routing-options autonomous-system [AS]
Neighbor Setupneighbor [IP] remote-as [AS]set protocols bgp group [Name] neighbor [IP] peer-as [AS]
Advertising Routesnetwork [IP] mask [Mask]Policy-based (export [Policy-Name])
Implicit DenyAdvertises nothing by defaultAdvertises nothing without an explicit Export Policy

4. Verification Commands

To check the status of your BGP peers and the routes being exchanged in Junos:

  • show bgp summary: Displays the state of the BGP neighbors. Look for the State column; "Established" means it is working.

  • show bgp neighbor: Provides detailed information about a specific neighbor.

  • show route protocol bgp: Shows all routes currently in the routing table that were learned via BGP.

  • show route advertising-protocol bgp 1.1.1.2: Verifies exactly what routes you are sending to that specific neighbor.

Checkout Juniper Network Simulator Juniper Netsim at certexams.com 

No comments:

Post a Comment