Routing
Highlighted
Routing

BGP - Originating Networks

10.01.09   |  
‎10-01-2009 03:09 PM

  Let's say I have a BGP connection to an ISP, and I want to advertise or "originate" a network to my ISP.   Let's say the network is 5.5.5.0/24.  In cisco I would use a command like "network 5.5.5.0 mask 255.255.255.0" to ensure I advertise that route to my BGP neighbors.

 

  In Juniper, I read that the default "export" policy for BGP is "Accept and export active BGP routes".  My router doesn't have any "active BGP routes" (lets say it just gets a default route from the ISP via BGP).  So by default my router wouldn't advertise any routes to the ISP via BGP correct?

 

  Let's say I have a prefix list that just contained 5.5.5.0/24.  If I have a policy statement that states "if from my prefix list, then accept", that would then initiate advertisement of the 5.5.5.0/24 network correct?

2 REPLIES
Routing

Re: BGP - Originating Networks

10.01.09   |  
‎10-01-2009 11:44 PM

Hello,

 

In order to advertise a route in BGP that has not been learned via BGP, two conditions must be reunited:

 1/ The route needs to be active in the routing table

 2/ You need to match and accept this route in a policy that is applied as "export" in BGP

 

A prefix-list is just that: a list of prefixes... it is just a handy way of referring to one or more ranges of addresses (say your core backbone...) but this does not imply these routes exist in the routing table. So a prefix-list addresses 2/ but not 1/.

 

Typically, you define an aggregate-route (5.5.5/24) to make it active in the routing-table (with a next-hop of discard or reject) and then match this in the export policy.

 

Regards,

/david 

Routing
Solution
Accepted by topic author i_noc
‎08-26-2015 01:27 AM

Re: BGP - Originating Networks

10.02.09   |  
‎10-02-2009 06:02 AM

Much like David said, the route needs to be active in the routing table and then you just need to write an export policy for it.

 

In my case, what I did was I put in a static route on my border router that routed the IP addresses I wanted to originate to the inside of our network:

 

set routing-options static route 5.5.5.0/24 next-hop ....

 

Afterwards I went ahead and created the prefix list and the export policy (I used exact here because I did not want anything else leaking out on accident.  You can use different switches that would also export shorter or longer routes)

 

policy-options {
    prefix-list your-ips {
        5.5.5.0/24;
    }
    policy-statement your-ips-to-advertise {
        term fgcu-ips {
            from {
                prefix-list-filter your-ips exact;
            }
            then accept;
        }
        term reject-all-else {
            then reject;
        }
    }

}

 

Then the export policy goes into your protocols statement:

 

protocols {
    bgp {
        group your-bgp-peers {
            export your-ips-to-advertise;
            neighbor your-isps-ip-here {
                peer-as XXXX;
            }
        }
    }
}

 

Hope that helps!

 

SH