Tuesday , 20 May 2025
Home » JUNIPER » UPSTREAM VLAN + BGP CONFIGURATION JUNIPER ROUTER STEP BY STEP

UPSTREAM VLAN + BGP CONFIGURATION JUNIPER ROUTER STEP BY STEP

UPSTREAM VLAN + BGP CONFIGURATION JUNIPER ROUTER STEP BY STEP

UPSTREAM VLAN + BGP CONFIGURATION JUNIPER ROUTER STEP-BY-STEP , Here’s how to configure a Juniper router for an upstream connection using VLAN and BGP. This is commonly used for connecting to an ISP or a data center uplink with a VLAN tag and establishing BGP peering.


📘 Use Case Example

  • Interface: ae0

  • VLAN ID: 3920

  • IP Address: 10.40.4.177/31

  • Upstream IP: 10.40.4.176/31

  • Local ASN: 141460

  • Upstream ASN: 58682

  • BGP Peer IP: 10.40.4.176


🛠 Step-by-Step Juniper Upstream VLAN + BGP Configuration

1. Enter Configuration Mode

cli
configure

2. Configure the VLAN Interface (Layer 3 Sub-interface)

set interfaces ae0 unit 3920 description L3-3920-INT
set interfaces ae0 unit 3920 vlan-id 3920
set interfaces ae0 unit 3920 family inet address 10.40.4.177/31

3. Configure BGP

set routing-options autonomous-system 141460
set protocols bgp group L3-INT-PRI-3920 type external
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 description L3-INT-PRI-3920
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 local-address 10.40.4.177
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 import L3-INT-PRI-IN
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 export L3-INT-PRI-OUT
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 peer-as 58629

4. Enable BGP Export/Import Policies 

JunOS requires policy for route export/import in BGP.

set policy-options policy-statement L3-INT-PRI-IN term 1 from route-filter 0.0.0.0/0 exact
set policy-options policy-statement L3-INT-PRI-IN term 1 then local-preference 250
set policy-options policy-statement L3-INT-PRI-IN term 1 then accept
set policy-options policy-statement L3-INT-PRI-IN term 1000 then reject
set policy-options policy-statement L3-INT-PRI-OUT term 1 from route-filter 103.159.255.0/24 exact
set policy-options policy-statement L3-INT-PRI-OUT term 1 then as-path-prepend "141460 141460 141460 141460"
set policy-options policy-statement L3-INT-PRI-OUT term 1 then accept
set policy-options policy-statement L3-INT-PRI-OUT term 2 from route-filter 103.159.254.0/24 exact
set policy-options policy-statement L3-INT-PRI-OUT term 2 then as-path-prepend "141460 141460 141460 141460"
set policy-options policy-statement L3-INT-PRI-OUT term 2 then accept
set policy-options policy-statement L3-INT-PRI-OUT term 1000 then reject

5. Commit Configuration

commit

✅ Summary of Key Commands

set interfaces ae0 unit 3920 description L3-3920-INT
set interfaces ae0 unit 3920 vlan-id 3920
set interfaces ae0 unit 3920 family inet address 10.40.4.177/31
set policy-options policy-statement L3-INT-PRI-IN term 1 from route-filter 0.0.0.0/0 exact
set policy-options policy-statement L3-INT-PRI-IN term 1 then local-preference 250
set policy-options policy-statement L3-INT-PRI-IN term 1 then accept
set policy-options policy-statement L3-INT-PRI-IN term 1000 then reject
set policy-options policy-statement L3-INT-PRI-OUT term 1 from route-filter 103.159.255.0/24 exact
set policy-options policy-statement L3-INT-PRI-OUT term 1 then as-path-prepend "141460 141460 141460 141460"
set policy-options policy-statement L3-INT-PRI-OUT term 1 then accept
set policy-options policy-statement L3-INT-PRI-OUT term 2 from route-filter 103.159.254.0/24 exact
set policy-options policy-statement L3-INT-PRI-OUT term 2 then as-path-prepend "141460 141460 141460 141460"
set policy-options policy-statement L3-INT-PRI-OUT term 2 then accept
set policy-options policy-statement L3-INT-PRI-OUT term 1000 then reject
set protocols bgp group L3-INT-PRI-3920 type external
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 description L3-INT-PRI-3920
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 local-address 10.40.4.177
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 import L3-INT-PRI-IN
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 export L3-INT-PRI-OUT
set protocols bgp group L3-INT-PRI-3920 neighbor 10.40.4.178 peer-as 58629

Let me know if you need help!

HOME

Check Also

BANDWIDTH EDIT OR SET IN JUNIPER ROUTER

BANDWIDTH EDIT OR SET IN JUNIPER ROUTER

BANDWIDTH EDIT OR SET IN JUNIPER ROUTER BANDWIDTH EDIT OR SET IN JUNIPER ROUTER, To …

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate »