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.

aviva@router1# set term 1 then next term<br />

aviva@router1# set term 2 from protocol static<br />

aviva@router1# set term 2 then local-preference 300<br />

aviva@router1# set term 2 then community set 65500:10300<br />

aviva@router1# set term 2 then next term<br />

aviva@router1# set final-term then reject<br />

Once again, explicitly configuring this action is optional because it is the default<br />

when a match occurs and you haven’t specified an accept, reject, or next term<br />

action.<br />

9.7 Making Sure a Routing Policy Is Functioning<br />

Properly<br />

Problem<br />

You want to ensure that a configured policy is working as intended by logging its<br />

actions.<br />

Solution<br />

There are two steps to setting up tracing to see how a configured routing policy is<br />

being applied to routes. First, include a trace action in the policy’s then clause:<br />

[edit policy-options policy-statement outbound-policy term 1]<br />

aviva@Router3# set then trace<br />

Then, set up a tracing file for capturing the output:<br />

[edit routing-options]<br />

aviva@Router3# set traceoptions file policy-trace-log size 10m files 10<br />

aviva@Router3# set traceoptions flag policy<br />

<strong>Discussion</strong><br />

When checking whether a routing policy is working, the first and easiest step is to<br />

check the entries in the routing table. Use the show route command on the local<br />

router to verify the effects of an imported routing policy and use the command on<br />

the neighboring router to check the effect of an export policy (see Recipe 8.1). This<br />

command shows the real-time effect of the configured routing policies. If, in examining<br />

the routing tables, you find routes you don’t expect or that routes are missing,<br />

use the JUNOS tracing function to keep a log of which routes a policy has analyzed<br />

and taken action on. This is a common way to debug problems that appear to be<br />

caused by a routing policy not being applied or not being applied properly.<br />

This recipe shows how to set up policy tracing. The set then trace command adds a<br />

tracing action to the policy. This command is part of a larger policy that is being<br />

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