In BGP, route-map is a command to set conditions for redistributing routes and to enable policy routing. On the Border Gateway Protocol > Route Map page, you can create route maps for particular networks, setting metric, weight, and/or preference values.
The best path algorithm, which decides which route to take, works as follows:
- Weight is checked.*
- Local preference is checked.*
- Local route is checked.
- AS path length is checked.
- Origin is checked.
- Metric is checked.*
This is only a short description. Since the calculation of the best path is very complex, please refer to pertinent documentation for detailed information which is available on the Internet.
Items followed by an asterisk (*) can be directly configured.
To create a BGP route map, do the following:
On the Route Map page, click New BGP Route Map.
The Add BGP Route Map dialog box opens.
Make the following settings:
Name: Enter a descriptive name for the route map.
Match by: Select whether the route map should match the IP address of a particular router or a whole AS.
- IP address: In the Networks dialog box, add or select hosts or networks the filter should apply to. How to add a definition is explained on the Definitions & Users > Network Definitions > Network Definitions page.
- AS number: In the AS Regex box, use BGP regular expressions to define AS numbers the filter should apply to. Example: _100_ matches any route going through AS100.
Networks: Add or select networks and/or hosts the route map should apply to. How to add a definition is explained on the Definitions & Users > Network Definitions > Network Definitions page.
Metric: By default, a router dynamically learns route metrics. However, you can set your own metric value which can be an integer from 0 to 4294967295. A lower metric value is preferred over a higher metric value.
Weight: Weight is used to select a best path. It is specified for a specific router and it is not propagated. When multiple routes to the same destination exist, routes with a higher weight value are preferred. Weight is based on the first matched AS path and can be an integer from 0 to 4294967295.
Note – If a neighbor has been given a weight, it overrides the route map weight if the route to a specified network matches.
Preference: You can set a preference value for the AS path which is sent only to all routers in the local AS. Preference (or local preference) tells the routers in an AS which path has to be preferred to reach a certain network outside the AS. It can be an integer from 0 to 4294967295 and the default is 100.
AS prepend: AS path prepending is used if preference settings for some reason do not suffice to avoid a certain route, for example a backup route which should only be taken in case the main route is unavailable. It allows you to extend the AS path attribute by repeating your own AS number, e.g. 65002 65002 65002. This influences the BGP route selection since the shortest AS path is preferred. Note that route maps with AS prepend set need to be selected in the Route Out field of a neighbor to work as intended.
The route map appears on the Route Map list.
You can now use the route map on a neighbor definition.