28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In the community identifier, you can use regular expressions to specify matches for<br />

the AS number and member identifier. The regular expressions have the same format<br />

as those for AS paths, consisting of a term and an operator, and they use the<br />

same operators as AS paths (see Table 13-1).<br />

Because the routing policy in the recipe matches an AS number, we need the set aspath<br />

command to define which ASs to look for.<br />

The second part of the process is creating a routing policy that references the community.<br />

The routing policy checks for BGP routes that have 65505 in their AS path and<br />

adds the community customer to any that match. Here’s what the policy-options portion<br />

of the configuration looks like:<br />

[edit policy-options]<br />

aviva@RouterF# show<br />

policy-statement community-add {<br />

term match-route {<br />

from {<br />

protocol bgp;<br />

as-path AS65505-path;<br />

}<br />

then {<br />

community add customer;<br />

accept;<br />

}<br />

}<br />

}<br />

community customer members 65500:1234;<br />

as-path AS65505-path "65505 .*";<br />

As with all policies, to have it take affect, apply it to BGP. Here, we apply it with an<br />

import statement on routes being learned from the EBGP peer to AS 65505.<br />

The detail option of the show route command lists the community attributes associated<br />

with a route:<br />

aviva@RouterF> show route detail 192.168.18.1<br />

inet.0: 18 destinations, 22 routes (18 active, 0 holddown, 0 hidden)<br />

192.168.18.1/32 (1 entry, 1 announced)<br />

*BGP Preference: 170/-101<br />

Next-hop reference count: 18<br />

Source: 10.0.31.1<br />

Next hop: 10.0.31.1 via t1-0/0/3.0, selected<br />

State: <br />

Local AS: 65500 Peer AS: 65505<br />

Age: 2d 18:35:30 Metric: 65<br />

Task: BGP_65505.10.0.31.1+2079<br />

Announcement bits (3): 0-KRT 3-BGP.0.0.0.0+179 4-Resolve tree 1<br />

AS path: 65505 I<br />

Communities: 65500:1234<br />

Localpref: 100<br />

Router ID: 192.168.14.1<br />

466 | Chapter 13: BGP<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!