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@RouterF# set term utility then accept<br />

aviva@RouterF# set term icmp from protocol icmp<br />

aviva@RouterF# set term icmp from icmp-type [ echo-request echo-reply unreachable<br />

time-exceeded source-quench ]<br />

aviva@RouterF# set term icmp then policer icmp<br />

aviva@RouterF# set term icmp then accept<br />

A final term in the filter counts and discards all remaining traffic:<br />

[edit firewall filter protect-RE2]<br />

aviva@RouterF# set term final-term then count discarded-packets<br />

aviva@RouterF# set term final-term then discard<br />

To have the filter take effect, apply it to the router’s lo0 interface:<br />

[edit interfaces]<br />

aviva@RouterF# set lo0 unit 0 family inet filter input protect-RE2<br />

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

It is considered good practice to apply policers to Routing Engine firewall filter terms<br />

to keep unwanted traffic and possible attacks from overwhelming the routing-protocol<br />

software, which runs on the Routing Engine. You want to police control traffic and<br />

traffic that is not time-dependent and you don’t want to police critical traffic, such as<br />

BGP protocol exchanges. This section provides a second example of a Routing<br />

Engine firewall filter that includes policers. It is based on a JUNOS secure template<br />

publicly available from Team Cymru at http://www.cymru.com.<br />

First, create policers for control and low-priority traffic. The first policer, configured<br />

with the set policer ssh commands, discards all SSH traffic when the bandwidth<br />

exceeds 1 MBor when the traffic burst size is greater than 100 Kbps. The second and<br />

third policers provide similar limits for ICMP and TCP traffic.<br />

The terms of the first three policers are the same, so you might wonder why you<br />

should bother creating separate policers. You could use just one, which is fine if you<br />

know that you will always want to use the same bandwidth and burst-size limits for<br />

these three types of traffic. However, if you think you might need to tweak the policers<br />

individually, this will be easier to do if you create separate policers initially.<br />

When you change the values, you will just need to reconfigure the policer. Otherwise,<br />

you will have to reconfigure both the policer and the firewall term in which the<br />

policer is used.<br />

The last policer in this recipe, configured with the set policer utility commands, is<br />

for background applications, including SNMP, NTP, and RADIUS. This policer drops<br />

traffic when the bandwidth is greater than 3 MB or a traffic burst exceeds 300 Kbps.<br />

You then apply the policers in the then clause of the firewall terms. You need a term<br />

for each type of traffic. The first term, configured with the set term tcp commands,<br />

accepts TCP control traffic only from trusted sources and rate-limits this traffic. The<br />

first two commands match prefix lists defined in the [edit policy] section of the<br />

configuration. As with the routing-policy prefix lists, you use these to keep a single<br />

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