luni, 30 aprilie 2012

CCNA - CCNP Training - BGP Weights - Computers - Networks

As a CCNA / CCNP candidate you are expected to understand the BGP Weight component in BGP path selection.

During your career as a Cisco network engineer may come across BGP and will be required to configure certain aspects of it operation. BGP is a very tuneable protocol which lets you engineer the paths which BGP chooses to reach prefixes it learned from any peers.One of the settings within BGP on a cisco router which we can use to tune the path chosen by BGP is called "Weight"

A Cisco router can look at the weight given to a route and determine if to take that route. When a Cisco router receives a BGP update it will set the weight either on a single prefix or on all the routes learnt via a particular neighbour.

The weight feature is a Cisco only feature which is therefore not found on any other BGP implementation on any other routers. Weight is never advertised to a neighboring router so it cannot be learnt from another router Cisco or otherwise. To use the weight feature it has to be set to look at all incoming routes from a neighbour, since this feature is a proprietary one and not supported on any other it is not known to be a path attribute. In any event the BGP update packets have no field in which they could communicate the weight value even if they wished to do so.

The weight value is set on an inbound route and has a range of between 0 and 65,535 (2 to the 16 power minus 1), Higher weight values are preferred over lower values, and the default setting is always zero for learned routes and 32,768 for locally injected routes, it is by the way at the time of writing not possible to change the default of 0.

Imagine two routers, one router has a peering arrangement with a neighbour known as 3.3.3.3, we are going to match all routes advertised to our router from 3.3.3.3 matching 10.10.10.0/24 prefix and apply a weight of 1000 Below we create an access list which is to be referenced in a route map in the next step to match the prefix we want to alter the weigh of.

Router #conf tRouter (config)#access-list 1 permit 10.10.10.0 0.0.0.255

The route map below matches the previously configured access list and sets the weigh to 1000, we must also configure an empty route map statement or other routes will not be seen from the Router, the route map will be named TO-R1

Router (config)#route-map TO-R1 permit 10Router (config-route-map)#match address 1Router (config-route-map)#set weight 1000Router (config)#route-map TO-R1 permit 20Router (config-route-map)#exit

Now we have to assign the route map under the BGP process in an "in" direction since the10.10.10.0/24 prefix is being advertised in an inbound direction to the router, now this device will give the route to the 10.10.10.0/24 network higher preference via the 3.3.3.3 peer.Router (config)#router bgp 400Router (config-router)#neighbor 3.3.3.3 route-map TO-R1 inR4(config-router)

Un comentariu: