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.

Solution<br />

Create a firewall filter for all incoming traffic to the router that will be used on interfaces<br />

facing the Internet. The filter contains a number of terms for different types of<br />

packets and for specific addresses.<br />

The first term discards unwanted traffic from specific addresses:<br />

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

aviva@RouterF# set term reject-addresses from source-address 172.68.0.0/16<br />

aviva@RouterF# set term reject-addresses from source-address 192.168.0.0/24<br />

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

The second term accepts traffic from BGP peers:<br />

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

aviva@RouterF# set term bgp-peers from destination-address 10.0.31.0/24<br />

aviva@RouterF# set term bgp-peers from protocol tcp<br />

aviva@RouterF# set term bgp-peers from port bgp<br />

aviva@RouterF# set term bgp-peers from tcp-established<br />

aviva@RouterF# set term bgp-peers then accept<br />

The third term accepts all ICMP traffic:<br />

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

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

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

The last term accepts all other packets:<br />

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

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

For the filter to take effect, apply it to an Internet-facing interface:<br />

[edit interfaces t1-0/0/3]<br />

aviva@RouterF# set unit 0 family inet filter input incoming-to-me<br />

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

There are two basic ways to design a firewall filter. One way is to block packets and<br />

traffic that the router shouldn’t receive and accept everything else, which is how the<br />

filter in this recipe operates. This type of filter design is fairly intuitive and, as you<br />

can see from this recipe, these filters are reasonably short and fairly easy to configure.<br />

One downside to this approach is that if you forget to block a particular type<br />

of traffic, you are opening yourself up to security breaches. The second design philosophy,<br />

of accepting only desired traffic and blocking everything else, is discussed<br />

in Recipe 9.15.<br />

This recipe is for an EBGP edge router that connects to the Internet. The filter is<br />

very straightforward, accepting all packets except for traffic coming from a few IP<br />

prefixes.<br />

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