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.

Chapter 4: Routing <strong>Policy</strong> <strong>Configuration</strong><br />

family family-name;<br />

match-conditions;<br />

policy subroutine-policy-name;<br />

prefix-list name;<br />

route-filter destination-prefix match-type ;<br />

source-address-filter source-prefix match-type ;<br />

}<br />

to {<br />

match-conditions;<br />

policy subroutine-policy-name;<br />

}<br />

then {<br />

actions;<br />

default-action (accept | reject);<br />

}<br />

}<br />

}<br />

}<br />

The resulting action is set either by the protocol or by the last policy term that is matched.<br />

Example: Configuring the Default Action in a Routing <strong>Policy</strong><br />

Configure a routing policy that matches routes based on three policy terms. If the route<br />

matches the first term, a certain community tag is attached. If the route matches two<br />

separate terms, then both community tags are attached. If the route does not match any<br />

terms, it is rejected (protocol’s default action). Note that the terms hub and spoke are<br />

mutually exclusive.<br />

[edit]<br />

policy-options {<br />

policy-statement test {<br />

term set-default {<br />

then default-action reject;<br />

}<br />

term hub {<br />

from interface ge-2/1/0.5;<br />

then {<br />

community add test-01-hub;<br />

default-action accept;<br />

}<br />

}<br />

term spoke {<br />

from interface [ ge-2/1/0.1 ge-2/1/0.2 ];<br />

then {<br />

community add test-01-spoke;<br />

default-action accept;<br />

}<br />

}<br />

term management {<br />

from protocol direct;<br />

then {<br />

community add management;<br />

default-action accept;<br />

}<br />

}<br />

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

55

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

Saved successfully!

Ooh no, something went wrong!