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.

If the route or packet does not match any of the conditions when the end of the policy<br />

or filter is reached, a default action is taken.<br />

A routing policy can have several match conditions, with multiple conditions in a<br />

single term, with several terms in the same policy, or with several policies chained<br />

together. Similarly, a firewall filter can have a number of match conditions. However,<br />

you can apply only one firewall filter on an input or output interface. To have a<br />

series of match conditions, you define multiple matches in a term or multiple terms<br />

in a single filter.<br />

Applying Policies and Filters<br />

After defining a policy or filter, you apply it to a protocol or interface. For a policy,<br />

you use import and export statements. An import policy applies when the router is<br />

evaluating routes received from a routing protocol before placing them into the routing<br />

table. An export policy applies when an active route in the routing table is sent in<br />

a routing-protocol advertisement. For a firewall filter, you use filter input and<br />

filter output statements for incoming and outgoing traffic on an interface.<br />

9.1 Creating a Simple Routing Policy<br />

Problem<br />

You want to advertise configured static routes to adjacent OSPF neighbors, going<br />

beyond the OSPF default of advertising only the routes learned from an OSPF<br />

neighbor.<br />

Solution<br />

To modify the route advertisement behavior, create and apply a routing policy. First,<br />

create the policy:<br />

[edit]<br />

aviva@router1# set policy-options policy-statement send-statics term 1 from protocol<br />

static<br />

aviva@router1# set policy-options policy-statement send-statics term 1 then accept<br />

Then, apply it to OSPF:<br />

[edit]<br />

aviva@router1# set protocols ospf export send-statics<br />

Here’s what the policy looks like in the configuration:<br />

[edit]<br />

aviva@router1# show<br />

policy-options {<br />

policy-statement send-statics {<br />

term 1 {<br />

from protocol static;<br />

284 | 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!