Hi vvadivel,
Thanks very much for the detail ed reply. Of course... that was stupid of me to apply the local preference outbound towards the iBGP peer. I can apply a local preference to any prefix learned FROm that peer, as I will need to perform a similar action on the peer router. The configuration will look like the following:
set protocols bgp group AS100 type internal
set protocols bgp group AS100 local-preference 50
set protocols bgp group AS100 neighbor 192.168.1.2
I really need to invest soe time in a lab, but for now, does the following configuration look like it will achieve the key tasks of:
1. setting the communities (community ispA and community ispB)
2. accepting any prefix asdie form our own from eeBGP peers (prefix-list AS100_private_prefixes)
3. export our prefixes to our eBGP peers (export-to-ispA andexport-to-ispB)
4. export prefixes learned form eBGP peers to our OSPF process ( policy-statement bgp-to-ospf)
On a related note, would people recommend exporting prefixes form BGP to OSPf in general?
Here is the corrected configuration for R1:
!!! R1 !!!
!
!!! Set the communities we would like to assign a community to private (ispA) and public (ispB) prefixes learned from AS1234 !!!
set policy-options community ispA members 1234:1
set policy-options community ispB members 1234:2
!
set policy-options policy-statement set-community-isp-a term 1 from as-path 1234
set policy-options policy-statement set-community-isp-a term 1 then community add ispA
set policy-options policy-statement set-community-isp-a term 1 then accept
!
set policy-options policy-statement set-community-isp-b term 1 from as-path 1234
set policy-options policy-statement set-community-isp-b term 1 then community add ispB
set policy-options policy-statement set-community-isp-b term 1 then accept
!
!!! RFC1918 prefixes which we will advertise to ispA !!!
set policy-options prefix-list AS100_private_prefixes 10.1.0.0/16
set policy-options prefix-list AS100_private_prefixes 10.2.0.0/16
!
!!! Public prefixes which we will advertise to ispB !!!
set policy-options prefix-list AS100_public_prefixes 255.255.1.0/24
!
!!! Accept any prefix from our ISP aside from our own (originated from AS100) and add the appropriate community !!!
set policy-options policy-statement import-from-ispA from protocol bgp
set policy-options policy-statement import-from-ispA term reject-routes from prefix-list AS100_private_prefixes
set policy-options policy-statement import-from-ispA term reject-routes then reject
!!! Add the community for export to OSPF !!!
set policy-options policy-statement import-from-ispA term all_else from as-path 1234
set policy-options policy-statement import-from-ispA term all_else then community add ispA
set policy-options policy-statement import-from-ispA term all_else then accept
!
set policy-options policy-statement import-from-ispB from protocol bgp
set policy-options policy-statement import-from-ispB term reject-routes from prefix-list AS100_public_prefixes
set policy-options policy-statement import-from-ispB term reject-routes then reject
!!! Add the community for export to OSPF !!!
set policy-options policy-statement import-from-ispB term all_else from as-path 1234
set policy-options policy-statement import-from-ispB term all_else then community add ispB
set policy-options policy-statement import-from-ispB term all_else then accept
!
!
set policy-options policy-statement export-to-ispA term get-routes from prefix-list AS100_private_prefixes
set policy-options policy-statement export-to-ispA term get-routes then accept
set policy-options policy-statement export-to-ispA term others then reject
!
set policy-options policy-statement export-to-ispB term get-routes from prefix-list AS100_public_prefixes
set policy-options policy-statement export-to-ispB term get-routes then accept
set policy-options policy-statement export-to-ispB term others then reject
!
!
!!! eBGP peering with our ISP !!!
set protocols bgp group ispA type external
set protocols bgp group ispA import import-from-ispA
set protocols bgp group ispA export export-to-ispA
set protocols bgp group ispA peer-as 1234
set protocols bgp group ispA neighbor 10.0.0.1
!
set protocols bgp group ispB type external
set protocols bgp group ispB import import-from-ispB
set protocols bgp group ispB export export-to-ispB
set protocols bgp group ispB peer-as 1234
set protocols bgp group ispB neighbor 10.0.0.3
!
!!! iBGP peer !!!
!
set protocols bgp group AS100 type internal
set protocols bgp group AS100 local-preference 50
set protocols bgp group AS100 neighbor 192.168.1.2
!
!!! Export all prefixes learned from ISP A and ISP B to OSPF !!!
set policy-options policy-statement bgp-to-ospf term 1 from protocol bgp
set policy-options policy-statement bgp-to-ospf term 1 from community ispA
set policy-options policy-statement bgp-to-ospf term 1 from community ispB
set policy-options policy-statement bgp-to-ospf term 1 then accept
!
@vvadivel wrote:
Hi Ottimo,
Please find the observations from your configuration provided for your design
set policy-options policy-statement import-from-ispB from protocol bgp == > import-from-ispA instead of import-from-ispB
set policy-options policy-statement import-from-ispA term reject-routes from prefix-list AS100_private_prefixes
set policy-options policy-statement import-from-ispA term reject-routes then reject
!!! Add the community for export to OSPF !!!
set policy-options policy-statement import-from-ispA term all_else from as-path 1234
set policy-options policy-statement import-from-ispA term all_else then community add ispA
set policy-options policy-statement import-from-ispA term all_else then accept
Change the policy name export-to-ispB :
set policy-options policy-statement export-to-ispA term get-routes from prefix-list AS100_public_prefixes
set policy-options policy-statement export-to-ispA term get-routes then accept
set policy-options policy-statement export-to-ispA term others then reject
This doesnot make any change because Local preference is local to the router you cannot advertise LP.
MED you can change and advertise
!!! set the local preference to 50 when advertised to iBGP peers !!!
set policy-options policy-statement set-local-pref term 1 from as-path 1234
set policy-options policy-statement set-local-pref term 1 then local-preference add 50
set policy-options policy-statement set-local-pref term 1 then accept
Like Below:
set policy-options policy-statement set-local-pref term 1 then metric <>
Hope this helps
--------------------------------------------------------------------------------------------------------
If this post was helpful, please mark this post as an "Accepted Solution".
Kudos are always appreciated!
--------------------------------------------------------------------------------------------------------
@vvadivel wrote:
Hi Ottimo,
Please find the observations from your configuration provided for your design
set policy-options policy-statement import-from-ispB from protocol bgp == > import-from-ispA instead of import-from-ispB
set policy-options policy-statement import-from-ispA term reject-routes from prefix-list AS100_private_prefixes
set policy-options policy-statement import-from-ispA term reject-routes then reject
!!! Add the community for export to OSPF !!!
set policy-options policy-statement import-from-ispA term all_else from as-path 1234
set policy-options policy-statement import-from-ispA term all_else then community add ispA
set policy-options policy-statement import-from-ispA term all_else then accept
Change the policy name export-to-ispB :
set policy-options policy-statement export-to-ispA term get-routes from prefix-list AS100_public_prefixes
set policy-options policy-statement export-to-ispA term get-routes then accept
set policy-options policy-statement export-to-ispA term others then reject
This doesnot make any change because Local preference is local to the router you cannot advertise LP.
MED you can change and advertise
!!! set the local preference to 50 when advertised to iBGP peers !!!
set policy-options policy-statement set-local-pref term 1 from as-path 1234
set policy-options policy-statement set-local-pref term 1 then local-preference add 50
set policy-options policy-statement set-local-pref term 1 then accept
Like Below:
set policy-options policy-statement set-local-pref term 1 then metric <>
Hope this helps
--------------------------------------------------------------------------------------------------------
If this post was helpful, please mark this post as an "Accepted Solution".
Kudos are always appreciated!
--------------------------------------------------------------------------------------------------------
set protocols ospf export bgp-to-ospf
!