Configuring Per Neighbor Weights Cont

Primary ISP

_ router bgp Customer-AS

neighbor Primary-ISP weight 150 g neighbor Backup-ISP weight 100 §'

Routes received from primary ISP should be preferred over routes received from backup ISP.

The weight is configured by the customer on both BGP sessions, giving a higher weight to the routes that are received from the primary ISP compared to those that are received from the backup ISP.

Any time that the multihomed customer receives routing information about the same IP network number from both the ISPs, the customer compares the weights assigned to the routes. Those received from the primary ISP will always win this comparison. The multihomed customer sends the outgoing IP packets to the destination network via the primary ISP regardless of the other BGP attributes that are assigned to both alternatives.

Consequently, the other customer that is directly connected to the backup ISP will also be reached via the primary ISP.

© 2005, Cisco Systems, Inc. Route Selection Using Attributes 4-9

Customer* show ip bgp

BGP table version is 16, local router ID is 1.2.3.4

Status codes: s suppressed, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete

Metric LocPrf Weight Path

32768 l

150 37 21 i 100 21 l

150 37 x

In this example, the multihomed customer has received routes to three different class A networks outside of its own AS (network 21.0.0.0/8, network 37.0.0.0/8, and network 40.0.0.0/8). The customer has received all three routes from both the primary ISP and the backup ISP.

When the routes were received from the primary ISP, the weight value 150 was assigned to each of the routes. When the routes were received from the backup ISP, the weight value 100 was assigned to each of the routes.

The customer router now makes the route selection. It has two alternative paths for each destination network. For each of them, the router selects the path via the primary ISP as the best. It makes this selection regardless of other BGP attributes, such as AS-path length.

The network 21.0.0.0/8 is reached via the primary ISP although it is actually a network in the AS of the backup ISP (AS 21).

The class A network 1.0.0.0/8 in this example is injected into the BGP table by this router. By default, locally sourced routes are assigned a weight of 32768.

4-10 Configuring BGP on Cisco Routers (BGP) v3.2

Changing Weights with Route-Maps

This topic describes how to influence the BGP route selection process by configuring BGP weights with route-maps.

The route-map is a powerful tool to select and alter routing information. When a route-map is applied to incoming information from a BGP neighbor, each received update is examined as it passes through the route-map. Statements in the route-map are executed in the order that is specified by their sequence numbers.

The first statement in the route-map for which all the match clauses indicate a match is the one that is used. If the route-map says "permit," the set clauses are applied to the route, the route is accepted, and the weight is changed.

Match clauses can be arbitrarily complex. One of them can refer to an AS-path access-list that does matching on AS paths. Another can refer to a prefix-list that does matching on the announced network number. Only when all configured match clauses are evaluated is the routemap statement used and its result, permit or deny, applied.

If a received route is not matched by any of the route-map statements, and the end of the routemap is reached, the route-map logic has an "implicit deny" rule. This rule means that if no statement selects a route, the route is discarded.

If the "implicit deny" rule is not desired, an "explicit permit all" at the end of the route-map can overrule it. To ensure that such a route-map statement is the last statement, you should assign it a very high sequence number. It should not have any match clause at all. The lack of a match clause means "match all." By not configuring any set clause, you can ensure that no attributes are altered by the statement.

© 2005, Cisco Systems, Inc. Route Selection Using Attributes 4-11

Example: Changing Weights with Route-Maps

This example shows a route-map that sets the weight value to each route that it receives from a neighbor.

Changing Weights with Route-Maps (Cont.)

Set weight 200 to networks coming from 2.3.4.5 originated in AS 21.

All received routes have their AS paths checked against the AS-path access-list 47. Those routes with an AS path that indicates that they originated in AS 21 are permitted by the AS-path access-list 47 as referenced by route-map statement number 10. Routes that are permitted and selected by route-map statement number 10 in the w200 route-map will have their weight set to 200 as indicated by the set clause in the route-map.

The routes that are not originated in AS 21 (routes that are not permitted by AS-path access-list 47) are then tested by route-map statement number 20. This statement does not include a match clause, indicating that all routes are matched. Therefore, all routes that are not matched by route-map statement 10 are matched by route-map statement 20. The route-map has been configured with an "explicit permit all" statement at the end of the route-map.

Routes that are matched by route-map statement 20 have their weight set to 100. The result is that the routes that originated in AS 21 are accepted by the router and assigned the weight 200. All others are accepted and assigned the weight 100. No route is discarded by this route-map.

Note Specifying weights with filter-lists is no longer supported in Cisco IOS Software Release

12.1, and the command has already been removed from Cisco IOS Software Release 12.1T. These releases use an incoming route-map, where you match an AS path with the match as-path command and set the weight with the set weight command. When you are using a route-map as a replacement for the filter-list with the weight option, make sure that specifying a "permit" entry in the route-map without an associated match condition does not filter all other routes. Using route-maps as a weight-setting mechanism is explained later in this lesson.

4-12 Configuring BGP on Cisco Routers (BGP) v3.2 © 2005, Cisco Systems, Inc.

Was this article helpful?

0 0
Search Engine Optimization Overview

Search Engine Optimization Overview

This is the 2nd volume of a 9 volume series called the Webmasters Toolbox package. Search engines are the number one way that internet users find websites. In most cases, a listing in a search engine is free. So, it's no surprise that Search Engine Optimization SEO is often the first priority when marketing a website.

Get My Free Ebook


Post a comment