16.03.2014 Views

Policy Framework Configuration Guide - Juniper Networks

Policy Framework Configuration Guide - Juniper Networks

Policy Framework Configuration Guide - Juniper Networks

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.

Junos 10.4 <strong>Policy</strong> <strong>Framework</strong> <strong>Configuration</strong> <strong>Guide</strong><br />

Example: Configuring a Subroutine<br />

Create the subroutine is-customer and call it from the routing policies export-customer<br />

and import-customer. In import-customer, the action is taken only on routes that match<br />

the route filters defined in is-customer.<br />

[edit]<br />

policy-options {<br />

policy-statement is-customer {<br />

term match-customer {<br />

from {<br />

route-filter 10.100.1.0/24 exact;<br />

route-filter 10.186.100.0/24 exact;<br />

}<br />

then accept;<br />

}<br />

term drop-others {<br />

then reject;<br />

}<br />

}<br />

policy-statement export-customer {<br />

from policy is-customer;<br />

then accept;<br />

}<br />

policy-statement import-customer {<br />

from {<br />

protocol bgp;<br />

policy is-customer;<br />

}<br />

then {<br />

local-preference 10;<br />

accept;<br />

}<br />

}<br />

}<br />

Configuring Routing <strong>Policy</strong> Match Conditions Based on Routing Table Entries<br />

In addition to defining match conditions in the from statement of a policy, you can use<br />

the condition statement to define conditions used during policy evaluation:<br />

condition condition-name {<br />

if-route-exists address table table-name;<br />

}<br />

You can include this statement at the following hierarchy levels:<br />

• [edit policy-options]<br />

• [edit logical-systems logical-system-name policy-options]<br />

To define a policy condition based on the existence of routes in specific tables for use in<br />

BGP export policies, specify a name for the condition and include the following options:<br />

• if-route-exists address—Specify the address of the route in question.<br />

132<br />

Copyright © 2010, <strong>Juniper</strong> <strong>Networks</strong>, Inc.

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

Saved successfully!

Ooh no, something went wrong!