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.

Two terms accept traffic from the network’s NTP servers and from ICMP:<br />

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

aviva@RouterF# edit term allow-ntp<br />

[edit firewall filter protect-RE term allow-ntp]<br />

aviva@RouterF# set from source-address 10.10.0.1/32<br />

aviva@RouterF# set from source-address 10.10.5.1/32<br />

aviva@RouterF# set from port ntp<br />

aviva@RouterF# set then accept<br />

aviva@RouterF# up<br />

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

aviva@RouterF# edit term allow-icmp<br />

[edit firewall filter protect-RE term allow-icmp]<br />

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

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

source-quench ]<br />

aviva@RouterF# set then accept<br />

The last term explicitly rejects all other traffic:<br />

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

aviva@RouterF# edit term allow-nothing-else<br />

[edit firewall filter protect-RE term allow-nothing-else]<br />

aviva@RouterF# set then count reject-counter<br />

aviva@RouterF# set then log<br />

aviva@RouterF# set then syslog<br />

aviva@RouterF# set then reject<br />

Create a system logfile for the messages that will be generated by the set then syslog<br />

command:<br />

[edit system syslog]<br />

aviva@RouterF# set file messages firewall any<br />

Finally, apply the filter to the router’s loopback interface:<br />

[edit interfaces lo0]<br />

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

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

This recipe illustrates the second broad firewall filter design philosophy mentioned<br />

in Recipe 9.11—that of creating a filter that allows only the desired traffic and blocks<br />

everything else. This design requires more planning than the reverse strategy of<br />

blocking traffic that the router should not receive first and then allowing everything<br />

else, but it ensures maximum security. You need to spend time up front looking at<br />

your network and router configurations and analyzing the flow of traffic through<br />

your network to determine the types of traffic the router should expect to receive and<br />

the addresses and ports from which it should receive the traffic. Another factor working<br />

in favor of improving the security of this design is that, by default, if a packet<br />

does not match any term in a firewall filter, it is discarded.<br />

This “allow known, block everything else” design is good practice for protecting the<br />

router’s Routing Engine. Because the JUNOS routing-protocol software runs on the<br />

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