On Thu, Mar 23, 2006 at 10:54:18AM +0100, Marcel Prisi wrote: > Hi all, > > A little success story : we just setup an OpenBSD-flashdist / OpenBGPd > "router-on-a-flash" for a small AS with great success. > > Thank you guys ! > > Just a little question : I would like to set local preference depending > on the total length of the AS-path. > > Sth like : > > (pseudo config) > > ip as-path access-list 1 permit ^[0-9]+$ (one AS) > ip as-path access-list 1 permit ^[0-9]+_[0-9]+$ (two AS's) > ip as-path access-list 1 permit ^[0-9]+_[0-9]+_[0-9]+$ (three AS's) > ! > route-map CC-IN permit 10 > match as-path 1 > set local pref better (101?) > ! > route-map CC-IN permit 20 > match bogon (ignore si t'as pas) > set local pref normal (100?) > ! > > How to do this using OpenBGPD ? Is it possible ? Any other similar > solution ? >
This is not possible in OpenBGPD. I'm not even sure why we should add something like that. Could you please tell me why you need to change localpref depending on the path length? The BGP decision process checks this: 1) nexthop state (reachable or not) 2) localpref 3) as path lenght 4) origin 5) MED 6) EBGP vs. IBGP 7) OpenBGPD special weight 8) nexthop costs (not implemented in OpenBGPD as there is no cost stored in the routing table) 9) route age if route-age evaluation is enabled 10) BGP Id 11) IP As you can see the AS Path length is compared right after the localpref so twisting the localpref depending on the AS Path lenght does not change that much. -- :wq Claudio

