3.7.d Implement, optimize and troubleshoot routing policies

3.7.d [i] Attribute manipulation

the tasks are on the diagram:


download this:

down arrow smaller


before AS-PATH manipulation:


note the ttl from ebgp multi-hop set for 2

AS-11#sh run | i multi
neighbor ebgp-multihop 2
neighbor ebgp-multihop 2


go to this link to analyze the cap yourself:

down arrow smaller


and this is the disable-connected:


the next task is to change the path to to use AS-55 using the AS-PATH attribute from AS-22:

AS-22(config-router)#neigh route-map AS-PATH out
AS-22(config-router)#route-map AS-PATH permit 10
AS-22(config-route-map)#set as-path prepend 22 22 22 22 22
AS-22(config-route-map)#match ip add
AS-22(config-route-map)#route-map AS-PATH permit 20
AS-22(config-route-map)#access-list 1 permit
AS-22(config)#router bgp 22
AS-22(config-router)#neigh route-map AS-PATH out


below is an excellent tutorial from cisco.com:


AS-33 will be set up in similar fashion; AS-11 will be slightly different.

i think the concept of inbound and outbound concerning these manipulations gives people headaches. i know it did me. and i also think it’s not explained very well.  try to think of it from the perspective of the advertising router. for instance, AS-11 will receive the 33 route directly from two sources, AS-22 and AS-55 (and indirectly from AS-33, the originator). however, from AS-22’s perspective it is receiving the route in from AS-33, and then advertising the route out, or toward AS-11. conversely, if we want to manipulate the route at AS-11, then the route will be incoming to AS-11 but the policy will be toward neighbor AS-22.

as in:


as with access-lists if desired, DO NOT FORGET the route-map permit at the end. that’ll bite you in the ass…