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 accept-null-path then accept<br />

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

This policy accepts all routes learned from BGP and that have no AS path, and<br />

rejects all other routes. A policy like this is useful when the only routes you want to<br />

advertise to a particular EBGP peer are those that originated in your AS. For<br />

instance, if another AS is advertising routes to you and you don’t want to readvertise<br />

them, you can apply this null AS path policy with a set export null-path command.<br />

13.9 Restricting the Number of Routes Advertised<br />

to a BGP Peer<br />

Problem<br />

You want to control the number of routes that your peers send you.<br />

Solution<br />

Set the maximum number of routes that you will accept from each of your peers:<br />

[edit protocols bgp group session-to-AS65505 neighbor 10.0.31.1]<br />

aviva@RouterF# set family inet unicast prefix-limit maximum 7500<br />

aviva@RouterF# set family inet unicast prefix-limit teardown<br />

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

As an ISP, you keep track of how many routes each of your peers and customers normally<br />

send you. This number generally increases slowly over time. To place a limit<br />

on the number of routes a peer or customer can send you, set a maximum number of<br />

routes to accept. This type of administrative policy guards against an inadvertent<br />

policy misconfiguration, which, in the worst case, could result in a peer or customer<br />

redistributing the full Internet routing table to you. You decide on the maximum<br />

number of prefixes you accept based on the normal number of routes exchanged<br />

with the peer, and, when the limit is reached, BGP tears down the session with the<br />

peer. Typically, you take the current number of routes exchanged and add about 50<br />

percent.<br />

In this recipe, we know that neighbor 10.0.31.1 typically sends 5,000 prefixes, so we<br />

set the limit to 7,500 prefixes. For example, if the peer tries to send the entire Internet<br />

routing table (on the order of 170,000 prefixes), BGP on the local router will shut<br />

down the peering session with the neighbor. This shutdown tells both you and the<br />

peer that something has gone wrong at his end.<br />

To verify the configuration, look at the BGP neighbor’s information:<br />

aviva@RouterF> show bgp neighbor 10.0.31.1<br />

Peer: 10.0.31.1+4051 AS 65505 Local: 10.0.31.2+179 AS 65500<br />

Description: EBGP to Customer A<br />

448 | Chapter 13: BGP<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!