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.

+ protocol Match IP protocol type<br />

+ protocol-except Do not match IP protocol type<br />

> source-address Match IP source address<br />

+ source-class Match source class<br />

+ source-class-except Do not match source class<br />

+ source-port Match TCP/UDP source port<br />

+ source-port-except Do not match TCP/UDP source port<br />

> source-prefix-list Match IP source prefixes in named list<br />

tcp-established Match packet of an established TCP connection<br />

tcp-flags<br />

Match TCP flags<br />

tcp-initial<br />

Match initial packet of a TCP connection<br />

You use the separate keyword with all match conditions that do not have an -except<br />

version.<br />

9.10 Reordering Firewall Terms<br />

Problem<br />

You want to change the order of terms in a firewall filter.<br />

Solution<br />

Use the CLI insert command to rearrange the terms in a firewall filter:<br />

[edit firewall filter incoming-to-me]<br />

aviva@RouterF# insert term restrict-bgp before term restrict-telnet-ssh<br />

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

One difference between routing policies and firewall filters is that while you can<br />

apply several routing policies to a routing protocol, chaining them together as necessary,<br />

you can apply only one incoming and one outgoing firewall filter to an interface.<br />

This means that firewall filters generally contain a large number of terms.<br />

As with routing policies, the order of the terms in a firewall filter is significant. Packets<br />

are tested against each term in the order. For performance and packet-handling<br />

efficiency, design each filter so the most important or time-critical packets are processed<br />

first. When you add a term to an existing filter, it appears at the end:<br />

[edit firewall filter incoming-to-me]<br />

aviva@router1# set term restrict-bgp from protocol tcp<br />

aviva@router1# set term restrict-bgp from port bgp<br />

aviva@router1# set term restrict-bgp from source-address 10.0.31.0/24<br />

aviva@router1# set term restrict-bgp then accept<br />

aviva@router1# show<br />

term restrict-telnet-ssh {<br />

from {<br />

source-address {<br />

10.0.0.0/8;<br />

}<br />

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