28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Let’s take a look at the three routing policies to see how they are evaluated when<br />

chained together:<br />

[edit]<br />

aviva@router1> show configuration policy-options<br />

policy-statement block-private {<br />

term 1 {<br />

from {<br />

route-filter 0.0.0.0/0 upto /7;<br />

route-filter 0.0.0.0/0 prefix-length-range /25-/32;<br />

route-filter 10.0.0.0/8 orlonger;<br />

route-filter 127.0.0.0/8 orlonger;<br />

route-filter 172.16.0.0/12 orlonger;<br />

route-filter 192.168.0.0/16 orlonger;<br />

route-filter 224.0.0.0/4 orlonger;<br />

}<br />

then reject;<br />

}<br />

}<br />

}<br />

policy-statement remove-communities {<br />

term 1 {<br />

then {<br />

community delete all-communities;<br />

}<br />

}<br />

}<br />

policy-statement send-statics {<br />

term 1 {<br />

from protocol [ static direct ];<br />

then accept;<br />

}<br />

}<br />

community all-communities members *:*;<br />

For routes being exported by the BGP group external-group, the policy evaluation<br />

first checks against the prefix ranges listed in the block-private policy, which keeps<br />

private addresses from being advertised to external ASs. Routes matching any one of<br />

the prefixes are rejected, and policy evaluation stops. Otherwise, routes are checked<br />

against the remove-communities policy. This policy has no match conditions, so all<br />

routes match and all community strings are removed from the route. Because this<br />

policy has no action that terminates policy evaluation (accept or reject), the evaluation<br />

continues with the next policy in the chain, send-statics, which redistributes<br />

static and direct routes to the BGP peers. At this point, if a route does not match any<br />

of the three routing policies, the default BGP export action is taken, which is to<br />

export only those routes learned from BGP and reject everything else.<br />

You can also design routing policies that are implicitly chained together. If a policy<br />

has no flow control action (then accept, then reject, then next term, orthen next<br />

policy) and has no more terms, policy evaluation automatically continues with the<br />

next policy if one is configured. The second two policies, remove-communities and<br />

send-statics, illustrate how this works. After the remove-communities policy removes<br />

298 | Chapter 9: Routing Policy and Firewall Filters<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!