Date created: Friday, October 23, 2015 1:30:28 PM. Last modified: Monday, November 13, 2017 4:59:04 PM

Inter-AS MPLS OptionA Example

Example of one side of a vrf-lite eBGP session for an Option A interconnect

 ! Configure new OptionA sub-interface
 set interfaces ge-0/0/1 unit 89 description Option-A-to-PE1-ge0/3/7.89
 set interfaces ge-0/0/1 unit 89 vlan-id 89
 set interfaces ge-0/0/1 unit 89 family inet address 172.21.109.206/30

 ! Configure import and export maps for this VRF, import from BGP must match an route targe
 set policy-options community Cust1_VRF members target:65001:89
 set policy-options policy-statement plc-VRF-Cust1-Import term 10 from protocol bgp
 set policy-options policy-statement plc-VRF-Cust1-Import term 10 from community Cust1_VRF
 set policy-options policy-statement plc-VRF-Cust1-Import term 10 then accept
 set policy-options policy-statement plc-VRF-Cust1-Export term 10 from protocol bgp
 set policy-options policy-statement plc-VRF-Cust1-Export term 10 then community add Cust1_VRF;
 set policy-options policy-statement plc-VRF-Cust1-Export term 10 then accept

 ! Configure new loopback in VRF to use as route distinguisher,
 ! This is the same IP used on lo0.0, will also be used for eBGP router ID
 set interfaces lo0 unit 89 family inet address 10.0.1.2/32
 
 ! Configure new routing instance
 set routing-instances Cust1-VRFdescription Cust1-VRF
 set routing-instances Cust1-VRF instance-type vrf
 set routing-instances Cust1-VRF interface lo0.89
 set routing-instances Cust1-VRF interface ge-0/0/1.89
 set routing-instances Cust1-VRF route-distinguisher 10.0.1.2:89
 set routing-instances Cust1-VRF vrf-import plc-VRF-Cust1-Import
 set routing-instances Cust1-VRF vrf-export plc-VRF-Cust1-Export
 set routing-instances Cust1-VRF vrf-table-label

 ! Configure BGP polices
 set policy-options policy-statement plc-VRF-Cust1-NNI-Import term 10 from protocol bgp
 set policy-options policy-statement plc-VRF-Cust1-NNI-Import term 10 then local-preference 20
 set policy-options policy-statement plc-VRF-Cust1-NNI-Import term 10 then accept
 set policy-options policy-statement plc-VRF-Cust1-NNI-Import term 20 then reject
 set policy-options policy-statement plc-VRF-Cust1-NNI-Export term 10 from protocol bgp
 set policy-options policy-statement plc-VRF-Cust1-NNI-Export term 10 then metric 10
 set policy-options policy-statement plc-VRF-Cust1-NNI-Export term 10 then accept
 set policy-options policy-statement plc-VRF-Cust1-NNI-Export term 20 then reject

 ! Configure new eBGP sessions to peer
 set routing-instances Cust1-VRF protocols bgp group InterAS-Peers type external peer-as 65002
 set routing-instances Cust1-VRF protocols bgp group InterAS-Peers neighbor 172.21.109.205 description AS-65002-PE2
 set routing-instances Cust1-VRF protocols bgp group InterAS-Peers neighbor 172.21.109.205 local-address 172.21.109.206
 set routing-instances Cust1-VRF protocols bgp group InterAS-Peers neighbor 172.21.109.205 import plc-VRF-Cust1-NNI-Import
 set routing-instances Cust1-VRF protocols bgp group InterAS-Peers neighbor 172.21.109.205 export plc-VRF-Cust1-NNI-Export

 ! Check and commit
 show | compare
 commit check
 commit confirmed 15 comment "New OptionA for Cust1 VRF"


 ! Check the new OptA BGP session is up and sending/receiving the inter-AS VRF routes
 show bgp summary instance Cust1
 show route receive-protocol bgp 172.21.109.205 table Cust1.inet.0
 show route receive-protocol bgp 172.21.109.205 table bgp.l3vpn.0
 show route advertising-protocol bgp 172.21.109.206 table Cust1.inet.0
 show route advertising-protocol bgp 172.21.109.206 table bgp.l3vpn.0

Exampe of setting the LP and MED for specific prefixes

# To set the LP or MED for specific prefixes
set policy-options policy-statement plc-LP-MED-Import term 5 from protocol bgp
set policy-options policy-statement plc-LP-MED-Import term 5 from route-filter 10.64.0.0/16 exact
set policy-options policy-statement plc-LP-MED-Import term 5 from route-filter 10.73.0.0/16 exact
set policy-options policy-statement plc-LP-MED-Import term 5 then local-preference 20
set policy-options policy-statement plc-LP-MED-Import term 5 then accept

# Insert before an existing term
insert policy-options policy-statement plc-LP-MED-Import term 5 before term 10 


set policy-options policy-statement plc-LP-MED-Export term 5 from protocol bgp
set policy-options policy-statement plc-LP-MED-Export term 5 from route-filter 10.64.0.0/16 exact
set policy-options policy-statement plc-LP-MED-Export term 5 from route-filter 10.73.0.0/16 exact
set policy-options policy-statement plc-LP-MED-Export term 5 then metric 10
set policy-options policy-statement plc-LP-MED-Export term 5 then accept

# Insert before an existing term
insert policy-options policy-statement plc-LP-MED-Export term 5 before term 10