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
------------------------------