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 />

export [ dmz local-customers ];<br />

}<br />

}<br />

Example: Applying Export and Import Policies to BGP Peer Groups<br />

For three BGP peer groups, apply various export and import filters.<br />

[edit]<br />

protocols {<br />

bgp {<br />

group 1 {<br />

type external;<br />

peer-as 47;<br />

export local-customers;<br />

import [ martian-filter long-prefix-filter as47-filter ];<br />

neighbor 192.168.1.4;<br />

neighbor 192.168.1.5;<br />

}<br />

group 2 {<br />

type external;<br />

peer-as 42;<br />

export local-customers;<br />

import [ martian-filter long-prefix-filter as42-filter ];<br />

neighbor 192.168.1.4;<br />

neighbor 192.168.1.5;<br />

}<br />

group 3 {<br />

type internal;<br />

export local-customers;<br />

neighbor 10.1.1.1;<br />

}<br />

}<br />

}<br />

Example: Defining a Routing <strong>Policy</strong> Based on the Number of BGP Communities<br />

Create a policy that accepts BGP routes based on the number of BGP communities. In<br />

this example, routes can contain two, three, or four communities to be considered a<br />

match. For example, if a route contains three communities, it is considered a match and<br />

is accepted. If a route contains one community, it is not considered a match and is rejected.<br />

[edit]<br />

policy-options {<br />

policy-statement import-bgp {<br />

term community {<br />

from {<br />

community-count 2 orhigher;<br />

community-count 4 orlower;<br />

}<br />

then {<br />

accept;<br />

}<br />

}<br />

}<br />

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

75

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

Saved successfully!

Ooh no, something went wrong!