[j-nsp] BGP filter

Tom Storey tom at snnap.net
Fri Feb 1 12:59:31 EST 2013


You could simplify it a little with an as-path-group and only need a single
term to match both.

You could also combine them in to a single regex like so:

"(65204|65205) .*"

Here is some information about as-path regexs from Juniper that also
confirms that "()" is null, i.e. originated in your AS.

http://www.juniper.net/techpubs/software/junos/junos94/swconfig-policy/defining-as-path-regular-expressions.html
http://www.juniper.net/techpubs/software/junos/junos74/swconfig74-policy/html/policy-extend-match-config3.html


On 1 February 2013 08:28, Riccardo S <dim0sal at hotmail.com> wrote:

>
> Or the reg-ex has to be written in this way ?
>
> set as-path from-AS-65204 ".*65204";
> set as-path from-AS-65205 ".*65205";
>
> Is the follwoing correct for the local bgp announcement ?
>
> set as-path from-local-router "()";
>
> Tks
>
> From: dim0sal at hotmail.com
> To: juniper-nsp at puck.nether.net
> Subject: BGP filter
> Date: Thu, 31 Jan 2013 08:51:49 +0000
>
>
>
>
>
> I'd like to filter BGP announcement based on the generating AS-path.
> In the example below I'd like to permit outbound announcement only if the
> generating AS is 65204 or 65025:
>
> [edit policy-options]
> # set as-path from-AS-65204 "65204.*"
> # set as-path from-AS-65205 "65205.*"
>
> [edit policy-options policy-statement BGP-filter-out ]
> # set term 1 from as-path from-AS-65204
> # set term 1 then accept
> # set term 2 from as-path from-AS-65205
> # set term 1 then accept
> # set term accept-others then reject
>
> [edit protocols bgp]
> # set group EBGP export BGP-filter-out
>
> Is there a better method to do it ?
>
> Tks
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp
>


More information about the juniper-nsp mailing list