Print Download PDF Send Feedback

Previous

Next

Configuring Route Maps - Gaia Clish (routemap)

Route maps support both IPv4 and IPv6 protocols, which includes RIP, RIPng, BGP, OSPFv2, and OSPFv3. You can only define BGP-4 Multiprotocol Extensions policy with route maps. For the other protocols, you can use route maps or the Route Redistribution and Inbound Route Filters features that you configure on the Portal.

Each route map includes a list of criteria and statements. You can apply route maps to inbound, outbound, or redistribution routes. Routes are compared to the match criteria, and all the actions defined in the criteria are applied to those routes which match all the criteria. You can set the match criteria in any order. If you do not define match criteria in a route map, the route map matches all routes.

You define route maps, then assign them to protocols for export or import policy for that protocol. Route maps override Portal based configuration.

To create a route map, use CLI commands to define a set of criteria that must be matched for the command to run. If the criteria are matched, then the system runs the actions you define. A route map is identified by a name and a number, an Allow or Restrict clause, and a collection of match and set statements.

There can be more than one instance of a route map (same name, different ID). The lowest numbered instance of a route map is checked first. Route map processing stops when all the criteria of a route map instance are matched, or all the instances of a route map are exhausted. If the criteria are matched, the actions in the section are run.

Routing protocols can use more than one route map when you set clear preference values for each. The applicable route map with lowest preference value is checked first.

Set Routemap Commands

To set a route map:

set routemap <rm_name> id {default | <1-65535>}

{on | off}

allow

inactive

restrict

Parameter

Description

routemap <rm_name>

The name of the route map.

id {default | <1-65535>}

Route map ID:

  • You can enter the keyword default. Default value is 10, or
  • Enter a value in the range of 1-65535.

{on | off}

  • on to create a route map,
  • off to delete a route map.

allow

Allow routes that match the route map.

 

inactive

Temporarily disable a route map. To activate the route map, use the allow or restrict arguments.

restrict

Do not allow routes that match the route map.

 

To configure actions for a routemap:

Note - Some statements have an effect on some protocols only.
The same parameter cannot appear both as a match and as an action statement in a route map. These include Community, Metric, and Nexthop.

set routemap <rm_name> id {default | <1-65535>} action

aspath-prepend-count <1-25>

community {append  |  replace  |  delete} {on | off}

community <1-65535> as <1-65535> {on | off}

community no-export {on | off}

community no-advertise {on | off}

community no-export-subconfed {on | off}

community none {on | off}

localpref <0-65535>

metric {add | subtract} <1-4294967295>

metric igp {add | subtract} <1-4294967295>

metric value <1-4294967295>

nexthop ip <ipv4_address>

nexthop ipv6 <ipv6_address>

precedence <0-65535>

preference <0-65535>

route-type {type-1 | type-2}

remove <action_name>

ospfautomatictag <0-4095>

ospfmanualtag <1-4294967295>

riptag <1-65535>

Parameter

Description

routemap <rm_name>

Name of route map.

id {default | <1-65535>}

Route map ID:

  • You can enter the keyword default. Default value is 10, or
  • Enter a value in the range of 1-65535.

aspath-prepend-count <1-25>

The number of times the local AS number is added to the beginning of the AS path. The number is added when routes which match the route map are advertised through BGP.

Only applicable to BGP and export of routes with export-routemap. The action is otherwise ignored.

community {append  | replace  | delete} {on | off}

Operates on a BGP community string. You can form a community string with these community action statements: append, replace, or delete. The default operation is append. BGP only.

If the action is set to replace, the Communities attribute is replaced with this Community ID and AS number for matching BGP routes.

If the action is set to append, then the given Community ID and AS number are added to the Communities attribute.

See also:

set routemap VALUE id VALUE action community append

set routemap VALUE id VALUE action community replace

community <1-65535> as <1-65535> {on | off}

A BGP community value.

community no-export {on | off}

This also applies to Standalone Autonomous Systems that are not part of a Confederation.

Only Applicable to BGP and export of routes with the export-routemap command. The action is otherwise ignored.

community no-advertise {on | off}

This action only applies to BGP, and only to export of routes through the export-routemap command. The action is otherwise ignored.

community no-export-subconfed {on | off}

This action only applies to BGP and export of routes through the export-routemap command. The action is otherwise ignored.

community none {on | off}

In action statement, this statement makes sense only if used with replace. This deletes all communities associated with a route so that the route has no communities associated with it. If is it used with append or delete, there is no operation.

The CLI returns an error if you turn none on and other community values are already defined, or if none is defined and you add another community value.

localpref <0-65535>

Set the local preference for BGP routes which match the route map. This action only applies to the BGP protocol, and only to route maps with the import-routemap command.

metric {add | subtract}
<1-4294967295.

Increments the metric of matching routes by the given amount.

This action only applies to:

  • Export of OSPF/OSPFv3 to BGP with export-routemap
  • Export of RIP/RIPng routes to BGP with export-routemap
  • Import of RIP/RIPng routes from other routers with import-routemap

This action otherwise has no effect. For example, in the import of OSPF/OSPFv3 routes from other routers.

In export of routes to BGP, the range of the resulting values is 0-4294967295.

In import of routes from RIP, the range of the resulting values is 1-65535. If the value is 16 or higher, the route is treated as unreachable and it is not installed in the kernel routing table.

In import of routes from OSPF, the range of the resulting values is 0-65535.

metric igp {add  |  subtract} <1-4294967295>

This action only applies in export of OSPF/OSPFv3 or RIP/RIPng routes to BGP with export-routemap. This action has no effect otherwise. The range of values for the resulting metric is 0-4294967295.

metric value <0-4294967295>

Sets the metric of matching routes to the given value.

For RIP the metric is metric, for OSPF the metric is cost, and for BGP the metric is MED. The actual range is different for each protocol.

In export to RIP or IPv6 RIP (RIPng), this action sets the RIP metric. The range of values is 1 - 65535, where 16 or larger shows that the route is unreachable.

In export to OSPF or IPv6 OSPF (OSPFv3), this action sets the OSPF route cost. The range of values is 0 - 65535.

In export to BGP, this action affects the BGP MED. The range of values is 0 - 4294967295.

This action only applies to route maps with the export-routemap command. It has no effect otherwise.

nexthop ip <ipv4_address>

Sets the IPv4 next hop address for routes that match this Route Map ID.

This action only applies to import or export of BGP routes.

 

precedence <0-65535>

Sets the priority of the routes which match the route map ID. Use this setting to give priority to routes of one protocol over the other. The route with the lower value has priority. The other routes are shown as inactive and are not installed in the kernel.

This action only applies to the import-routemap command.

See also:

set protocol-rank

set static-route VALUE rank

preference <0-65535>

Applies only to routes received through BGP advertisements. This is equivalent to the bgp weight (in Cisco terms) of the route. However, unlike Cisco, the route with the lower value has precedence. This value only applies to the local router.

route-type {type-1  |  type-2}

Type of OSPF external route. The metric type of AS External route is set to the specified value. Only applies when used with export-routemap to export routes to other routers through OSPF or OSPFv3.

remove <action_name>

Remove the specified action from the route map. For community, it removes all community statements. Permitted values:

  • aspath-prepend-count
  • community
  • localpref
  • metric
  • nexthop
  • ospfautomatictag
  • ospfmanualtag
  • precedence
  • preference
  • riptag
  • route-type

ospfautomatictag <0-4095>

Creates an automatic tag for OSPF external routes that match the route map.

This action only applies to export of non-OSPF routes into OSPF with export-routemap. See RFC 1403 for more information on OSPF tags.

ospfmanualtag <1-4294967295>

Creates a manual tag for OSPF external routes that match the route map.

This action only applies to export of non-OSPF routes into OSPF with export-routemap. See RFC 1403 for more information on OSPF tags.

riptag <1-65535>

Creates a RIP tag for external routes that match the given Route Map ID.

This action only applies to export of non-RIP routes into RIP with export-routemap. See RFC 2453 for more information on RIP route tags.

To configure the route map criteria:

Note - Some statements have an effect on some protocols only.
The same parameter cannot show both as a match and as an action statement in a route map. These include Community, Metric, and Nexthop.

set routemap <rm_name> id {default | <1-65535>} match

as <1-65535> {on | off}

aspath-regex {regular_expression} | empty} origin {any | egp | igp | incomplete}

community

<1-65535> as <1-65535> {on | off}

exact {on | off}

no-export {on | off}

no-advertise {on | off}

no-export-subconfed {on | off}

none {on | off}

ifaddress <interface_address> {on | off}

interface <interface_name> {on | off}

metric value <0-4294967295>

neighbor <ip_address> {on | off}

network <network>/<mask_length>

all [restrict]

exact [restrict]

refines [restrict]

between <mask_length> and <mask_length>[restrict]

off

nexthop <ip_address> {on | off}

protocol <protocol_name>

route-type {type-1 | type-2 | inter-area | intra-area} {on | off}

remove <match condition name>

tag <tag_name>

Parameter

Description

as <1-65535> {on | off}

Configures the route map to only match routes which are received from or advertised to the given BGP AS number. Applies to BGP only.

You can configure multiple AS match conditions for a given route map ID. A match occurs when one of the AS conditions matches a given route.

This match condition applies to both the import-routemap and export-routemap commands, but only for BGP.

aspath-regex {<regular-expression>  | empty} origin {any  | egp | igp  | incomplete}

aspath-regex

Match the specified aspath regular expression. For BGP only.

The regular expression can have only digits, metacharacters and Gaia Clish special characters.

origin

Configures the route origin type for the match condition.

This match condition applies to both import-routemap and export-routemap, but only for BGP.

community <1-65535> as <1-65535> {on | off}

Configures the route map to match the given BGP Community ID and Community AS number.

This match condition applies to both import-routemap and export-routemap, but only for BGP.

If you configure multiple community match conditions under a given route map ID, then a given BGP route must match each condition to match the route map.

community exact {on | off}

Matches the communities in the route to the communities in the route map. If there is no exact clause, the route can have other community values related to it in addition to the ones in the route map. You can have multiple community statements in a route map to form a community string.

The Community String(s) to be matched must be added to this Route Map ID with this command:

set routemap <Route Map Name> id <Route Map ID> match\

community <Community-ID> as <AS-Number> on

This match condition applies only to BGP, both for import-routemap and export-routemap.

community no-export {on | off}

This option also applies to Standalone Autonomous Systems that are not part of a Confederation.

This match condition applies only to BGP, both for import-routemap and export-routemap.

community no-advertise {on | off}

This match condition applies only to BGP, both for import-routemap and export-routemap.

community no-export-subconfed {on | off}

For Confederations, routes with this value are not advertised to peers with a different Routing Domain Identifier.

This match condition applies only to BGP, both for import-routemap and export-routemap.

community none {on | off}

Matches an empty community string, namely, a route with no communities related to it.

The CLI returns an error if you turn none on and other community values are already defined, or if none is defined and you add some other community value.

This match condition applies only to BGP, both for import-routemap and export-routemap.

ifaddress <interface_address> {on | off}

Configures the route map to match the specified interface address.

Value: an IPv4 or IPv6 interface address

For example: 192.168.2.14

The given IP address is matched against the address of the interface which received the route.

There can be multiple match conditions for interface address under the same route map ID. This type of match condition applies to route maps which are used with import-routemap and to route maps which are used with export-routemap.

interface <interface_name> {on  |  off}

Match the route if the nexthop lies on the specified interface name. There can be multiple interface statements.

metric value
<0-4294967295>

Configures the route map to match routes with a specified metric.

This match condition applies RIP, BGP, and OSPF.

For RIP and IPv6 RIP (RIPng), this matches the RIP metric. The valid range of values is 1-65535. If the value is 16 or higher, the route is unreachable.

For OSPF and IPv6 OSPF (OSPFv3), this value matches the route cost. The valid range of values is 0 - 65535.

For BGP, this value matches the MED. The valid range of values is 0 - 4294967295.

neighbor <ip_address> {on | off}

Configures the Route Map to match routes from the given neighbor.

Value: an IPv4 or IPv6 network address

For example: 192.168.2.14

This match rule only applies to BGP or RIP and only with import-routemap.

You can configure multiple neighbor match conditions for a given route map ID.

network <network>/<mask_length> all [restrict]

Configures the route map to match all routes which are equal to or contained within the specified IPv4 or IPv6 subnet. The subnet is expressed by CIDR notation.

Examples: 192.168.2.0/24, fc00:1:2:3::/64

If restrict is specified, it prevents import or export of matching routes.

network <network>/<mask_length> exact [restrict]

Configures the route map to only match routes with the same prefix and mask length as the given IPv4 or IPv6 subnet. The subnet is expressed by CIDR notation.

Examples: 192.168.2.0/24, fc00:1:2:3::/64

If restrict is specified, it prevents import or export of matching routes.

network <network>/<mask_length> refines [restrict]

Configures the route map to match routes which are contained within the given IPv4 or IPv6 subnet. Routes which match the given subnet exactly (namely, which have the same mask length) are excluded from the match. The subnet is expressed by CIDR notation.

Examples: 192.168.2.0/24, fc00:1:2:3::/64

If restrict is specified, it prevents import or export of matching routes.

network <network>/<mask_length> between <mask_length> and <mask_length> [restrict]

Configures the Route Map to match routes that are within the given IPv4 or IPv6 subnet and which have a mask length that is between the given range of values. The subnet is expressed by CIDR notation

Examples: 192.168.2.0/24, fc00:1:2:3::/64

If restrict is specified, it prevents import or export of matching routes.

network <network>/<mask_length> off

Deletes the network match statement.

nexthop <ip_addr> {on | off}

Configures the route map to match routes with a given IPv4 or IPv6 next hop gateway address.

For example: 192.168.2.14

You can configure multiple next hop match conditions for a given route map ID. A match occurs if a next hop value matches a given route.

This match only applies to BGP and only with export-routemap.

protocol <protocol_name

Configures the route map to match routes of the given protocol type. Use this for route redistribution between protocols.

<protocol_name>:

  • static - static routes
  • direct - interface routes
  • aggregate - aggregate routes
  • rip - RIP routes
  • ripng - RIPng (IPv6 RIP) routes
  • ospf2 - OSPFv2 routes
  • ospf2ase - OSPVv2 external routes
  • ospf3 - OSPFv3 (IPv6 OSPF) routes
  • ospf3ase - OSPFv3 external routes
  • bgp - BGP routes
  • kernel - kernel (injected) routes

This match condition only applies to export-routemap and is ignored for import-routemap. You can define one protocol match condition for a given route map ID. If you do not define a match condition, the default behavior is to export only RIP routes to the RIP protocol, only BGP routes to the BGP protocol, and so on.

route-type {type-1  | type-2  | inter-area  | intra-area} {on | off}

Configures the route map to match the given route type.

This match condition applies only to export-routemap, in the export of routes to other routers through OSPF or OSPFv3.

If you define a route type of inter-area or intra-area, set the protocol match condition to ospf2. If you define a route type of type-1 or type-2, set the protocol match condition to ospf2ase. In the export of OSPF ASE routes to other protocols, if the metric match condition is set but the route type match condition is not set, it will try to match the metric value for both type-1 and type-2 routes. There can be multiple route type match conditions.

Best Practice - Do not use this match condition simultaneously with the route-type action.

remove <match condition name>

Removes the specified match condition from the routemap. If a match condition has multiple match statements (such as network, neighbor), this argument removes all of them.

Permitted values:

  • as
  • aspath-regex
  • community
  • community-regex
  • ifaddress
  • interface
  • metric
  • neighbor
  • network
  • nexthop
  • protocol
  • route-type
  • tag

tag <tag_name>

Matches OSPF external routes with the given tag value.

Value: 1 - 4294967295

You can add multiple tag match conditions to a given route map ID to broaden the range of matched tag values. Currently, you can only use this feature to export OSPF routes to BGP.