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.

list of IP addresses in one place in the configuration. The ssh-prefixes list has all the<br />

SSH servers in your network, and the bgp-prefixes list has all your BGP peers. The<br />

last from clause command matches bits found in TCP control traffic. The first option,<br />

(syn & !ack), matches TCP synchronize packets that are being used to establish connections.<br />

For connections that are already established and operating normally, these<br />

packets also have the ACK bit set, so we exclude these packets from the policer limits.<br />

The RST option is present in packets resetting a TCP session, and FIN indicates<br />

that a session has closed and there is no more data from the sender. You must<br />

enclose the bits in quotation marks so the CLI interprets them correctly. The final<br />

two commands in this term configure the action. The first command applies the tcp<br />

policer, and the second accepts the packets.<br />

After the tcp term, you should add the following filter term to accept BGP traffic<br />

from trusted sources:<br />

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

aviva@RouterF# set term bgp from source-prefix-list bgp-prefixes<br />

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

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

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

The first three commands match packets from a prefix list configured in the [edit<br />

policy] section that lists the router’s BGP peers, and this traffic is TCP protocol traffic<br />

sent from the BGP port. The then clause accepts these packets. You don’t ratelimit<br />

BGP traffic, because it must be received and handled by the Routing Engine.<br />

The ssh, utility, and icmp terms in the filter are similar, accepting and rate-limiting<br />

SSH, SNMP, NTP, RADIUS, and ICMP packets. The last term, final-term, counts<br />

and discards all remaining traffic.<br />

Finally, to have the filter take effect, apply it to the lo0 interface.<br />

9.17 Using Counters to Determine Whether a Router<br />

Is Under Attack<br />

Problem<br />

You want to count traffic on an interface to help determine whether a router is under<br />

attack.<br />

Solution<br />

If you suspect that an attack includes TCP packets, add a counter to the firewall term<br />

that counts all TCP traffic:<br />

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

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

Using Counters to Determine Whether a Router Is Under Attack | 329<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!