Routing

 View Only
last person joined: yesterday 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
Expand all | Collapse all

Establish two BGP sessions with different ASNs on the same neighbours.

  • 1.  Establish two BGP sessions with different ASNs on the same neighbours.

    Posted 06-07-2024 18:55
    Hello,
     
    I currently have an unusual configuration with a peering point, and I need to establish two BGP sessions because we have two ASNs. This connection is made through a physical link where we have been asked to use two VLANs, each with a different MAC address. In both VLANs, the IP addresses share the same segment. For this, I have configured the following:
     
    ```juniper
    set vlans VLAN100 vlan-id 100
    set vlans VLAN101 vlan-id 101
    set bridge-domains BD100 vlan-id 100
    set bridge-domains BD101 vlan-id 101
    set interfaces irb unit 100 family inet address x.x.x.220/23
    set interfaces irb unit 100 mac 00:cc:34:f7:12:ed
    set interfaces irb unit 101 family inet address x.x.x.118/23
    set interfaces irb unit 101 mac 00:cc:34:a9:d4:1e
     
    set bridge-domains BD100 routing-interface irb.100
    set bridge-domains BD101 routing-interface irb.101
     
    set interfaces xe-0/1/2 vlan-tagging
    set interfaces xe-0/1/2 no-gratuitous-arp-reply
    set interfaces xe-0/1/2 unit 0 family bridge interface-mode trunk
    set interfaces xe-0/1/2 unit 0 family bridge vlan-id-list [100 101]
    ```
     
    I am open to corrections if there are any mistakes in this configuration, as it is the best way I have been able to implement it.
     
    Now, my challenge is to establish two BGP sessions with different ASNs as follows:
     
    **ASN1**
    - Local IP: x.x.x.220
    - Neighbor IP: x.x.x.1
    - Neighbor IP: x.x.x.2
     
    **ASN2**
    - Local IP: x.x.x.118
    - Neighbor IP: x.x.x.1
    - Neighbor IP: x.x.x.2
     
    The problem I am facing is that I cannot establish two BGP sessions with both ASNs using the same peers. I have considered using virtual routers, but I am not sure if it is the best option since, besides these BGP sessions, we have others where we advertise our public IP segments.
     
    I have tried the following configuration, but I am unable to announce the routes properly:
     
    ```juniper
    set routing-instances AS1 instance-type virtual-router
    set routing-instances AS1 interface irb.100
     
    set routing-instances AS2 instance-type virtual-router
    set routing-instances AS2 interface irb.101
     
    set routing-instances AS1 routing-options interface-routes rib-group inet export-to-global
    set routing-instances AS1 protocols bgp group GAS1 type external
    set routing-instances AS1 protocols bgp group GAS1 peer-as XXX
    set routing-instances AS1 protocols bgp group GAS1 local-address x.x.x.220
    set routing-instances AS1 protocols bgp group GAS1 local-as AS1
    set routing-instances AS1 protocols bgp group GAS1 neighbor x.x.x.1
    set routing-instances AS1 protocols bgp group GAS1 neighbor x.x.x.2
    set routing-instances AS1 protocols bgp group GAS1 export Export-AS1
    set routing-instances AS1 protocols bgp group GAS1 export EXPORT_FROM_AS1
     
    set routing-instances AS2 routing-options interface-routes rib-group inet export-to-global
    set routing-instances AS2 protocols bgp group GAS2 export EXPORT_FROM_AS2
    set routing-instances AS2 protocols bgp group GAS2 type external
    set routing-instances AS2 protocols bgp group GAS2 peer-as XXX
    set routing-instances AS2 protocols bgp group GAS2 local-address x.x.x.118
    set routing-instances AS2 protocols bgp group GAS2 local-as AS2
    set routing-instances AS2 protocols bgp group GAS2 neighbor x.x.x.1
    set routing-instances AS2 protocols bgp group GAS2 neighbor x.x.x.2
    set routing-instances AS2 protocols bgp group GAS2 export EXPORT_FROM_AS2
    set routing-instances AS2 protocols bgp group GAS2 export Export-AS2
     
    set routing-options rib-groups export-to-global import-rib AS1.inet.0
     
    set policy-options policy-statement EXPORT_FROM_AS1 term 1 from protocol bgp
    set policy-options policy-statement EXPORT_FROM_AS1 then accept
     
    set routing-options rib-groups export-to-global import-rib AS2.inet.0
     
    set policy-options policy-statement EXPORT_FROM_AS2 term 1 from protocol bgp
    set policy-options policy-statement EXPORT_FROM_AS2 then accept
     
    set policy-options policy-statement Export-AS1 term 1 from route-filter a.a.a.a/22 upto /24
    set policy-options policy-statement Export-AS1 term 1 then accept
    set policy-options policy-statement Export-AS1 term 2 then reject
     
    set policy-options policy-statement Export-AS2 term 1 from route-filter b.b.b.b/22 upto /24
    set policy-options policy-statement Export-AS2 term 1 then accept
    set policy-options policy-statement Export-AS2 term 2 then reject
    ```
     
    I would appreciate any guidance or suggestions you can provide to correctly configure these two BGP sessions and whether my current approach is correct.


    ------------------------------
    JavierV
    ------------------------------


  • 2.  RE: Establish two BGP sessions with different ASNs on the same neighbours.

    Posted 07-02-2024 07:19

    Hi Javier,

    would be great to have the IP (you can replace them with a fake values) as this will bring a bit more understanding what are the ranges you are using.

    For now I see a few issues:

    • no static route to x.x.x.1 and x.x.x.2 (or there is an IGP?)
    • the eBGP in your case is "multihop"  - so this is also missing in your config
    • I see some issues in my lab, when I use local address a "transferNET ip" and peer IP is Lo0 from remote device, so maybe you can/should use lo0 (and relevant static routes) at both ends. 

      BR,


    ------------------------------
    Andrei Cebotareanu
    ------------------------------