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.

Table 9-3. General actions to take on matching routes<br />

Action term Description Additional action taken<br />

accept Accept the route and propagate it. Evaluation of the policy statement ends. If the policy has<br />

more terms, they are ignored. If the policy is part of a chain<br />

of policies, any subsequent policies are ignored.<br />

reject Reject the route and do not propagate it. Evaluation of the policy statement ends. If the policy has<br />

more terms, they are ignored. If the policy is part of a chain<br />

of policies, any subsequent policies are ignored.<br />

next term Take any actions in the then clause that<br />

modify the route properties.<br />

Any accept or reject action is ignored, and evaluation of the<br />

policy statement jumps to the next term in the policy.<br />

next policy<br />

Take any actions in the then clause that<br />

modify the route properties.<br />

Because the policy in this recipe has one term, if the packet matches all the conditions<br />

(similar to a logical AND action), the action is taken. If there are no actions or<br />

if a route does not match all the conditions, the default accept or reject action is<br />

taken, which for OSPF is to reject the route and not advertise it. If a routing policy<br />

has multiple terms, they are evaluated sequentially. As soon as the route matches a<br />

term, the action in that term is taken and policy evaluation completes. If the route<br />

does not match any of the terms, the default action for that protocol is taken.<br />

The then clause can include additional actions that modify the route properties.<br />

These are discussed in Recipe 9.2.<br />

The third command in the recipe, set export send-statics, applies the policy to<br />

OSPF, referencing it by name. The set export command affects routes that OSPF<br />

advertises to its peers. By default, OSPF advertises only routes learned from other<br />

OSPF routers. This policy configures OSPF to also advertise any static routes configured<br />

on the local router.<br />

Use the show policy command to see which policies are configured:<br />

aviva@router1> show policy<br />

Configured policies:<br />

send-statics<br />

Any accept or reject action is ignored, any subsequent<br />

terms in the policy are ignored, and evaluation of the policy<br />

statement jumps to the next policy in the chain.<br />

For just one policy, the output is not very interesting. However, if the configuration<br />

contains a number of routing policies, this command is a good way to get a quick list<br />

of the policies.<br />

Because all routing policies are in a common place in the configuration (in the [edit<br />

policy-options] hierarchy), you can refer to them more than once when configuring<br />

a routing protocol. For example, you can use the policy in this recipe to redistribute<br />

static routes into an EBGP group. Because the policy is already defined, you need to<br />

just reference the EBGP group:<br />

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