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.

number of interfaces. Another option in this case is to associate this filter with the<br />

router’s loopback interface, lo0, which filters traffic going to the Routing Engine:<br />

[edit interfaces]<br />

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

Because SSH requests are handled by the Routing Engine, instead of applying the filter<br />

to many or all of the router’s physical interfaces, you can effect the same filtering<br />

by setting it on the loopback interface.<br />

As defined, this filter works only on IPv4 traffic, because you configure it at the [edit<br />

firewall] level. To have it work for IPv6 traffic, you need to configure the filter at<br />

the [edit firewall family inet6] hierarchy:<br />

[edit firewall family inet6]<br />

aviva@router1# set filter incoming-to-me term restrict-telnet-ssh from protocol tcp<br />

...<br />

Then apply the filter to IPv6 traffic when configuring the interface’s IPv6 address<br />

family:<br />

[edit]<br />

aviva@router1# set interfaces fe-0/0/0 unit 0 family inet6 filter input incoming-tome<br />

If your router has filters for both IPv4 and IPv6 traffic, you should define the IPv4<br />

firewall filters at the [edit firewall family inet] hierarchy so it will be clear to someone<br />

reading through the configuration which filters apply to IPv4 and which apply to<br />

IPv6:<br />

[edit firewall family inet]<br />

aviva@router1# set filter ipv4-incoming-to-me term restrict-telnet-ssh from protocol<br />

tcp<br />

[edit firewall family inet6]<br />

aviva@router1# set filter ipv6-incoming-to-me term restrict-telnet-ssh from protocol<br />

tcp<br />

The first three commands in the recipe, which form the from clause, set the filter’s<br />

match conditions, defining which fields in the packet headers to examine. Firewall<br />

filters can match various fields in the headers (see Table 9-5).<br />

Table 9-5. Header match conditions used in firewall filters<br />

Match term<br />

Address matches<br />

address prefix<br />

destination-address<br />

prefix<br />

source-address prefix<br />

destination-prefix-list<br />

prefix-list<br />

Match description<br />

IP address in the source or destination field.<br />

IP address in the destination field.<br />

IP address in the source field.<br />

IP destination address of one of the prefixes in the prefix list.<br />

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