[j-nsp] BGP route origination with communities

David Gethings davidg at pipex.net
Sun Aug 15 06:55:23 EDT 2004


On 15 Aug 2004, at 09:34, Mark Johnson wrote:

> Hi,
>
> Switching from Cisco to Juniper and I'm stuggling to originate BGP
> routes with community tags. On a Cisco I use:
>
> router bgp 1234
>   network 192.168.224.0 mask 255.255.224.0 route-map 
> set-local-community
>
> route-map set-local-community permit 10
>  set community AS:180 AS:800
>
>  ip route 192.168.224.0 255.255.224.0 null0 254
>
> And it works like a dream.
>
> What is the best way to replicate this in JunOS keeping in mind that
> some routes like this don't have more specifics so adding the community
> to a static discard won't work.
As with most things in Junos there is more than one way to do it. The 
most direct comparison to what you want to do is the following config:

routing-options {
   autonomous-system 1234;
   static {
     route 192.168.224.0/23 discard;
   }
}
protocols {
   bgp {
     export set-local-community;
   }
}
policy-options {
   policy-statement set-local-community {
     term 1 {
       then {
         community set my-180;
         community add my-800;
       }
     }
   }
   community my-180 members 1234:180;
   community my-800 members 1234:800;
}

Cheers

Dg



More information about the juniper-nsp mailing list