Configuring a Routemap

Configuring a Routemap

Syntax:

set routemap <Name of Routemap> id {<1-65535> | default}

      {off | on}

      allow

      inactive

      restrict

Parameters:

Parameter

Description

routemap <Name of Routemap>

The name of the routemap.

id {<1-65535> | default}

The ID of the routemap.

You can enter the keyword "default" or the default value "10".

{off | on}

Control the routemap:

  • off - To delete a routemap.

  • on - To create a routemap,

allow

Allow routes that match the routemap.

inactive

Temporarily disable a routemap.

To activate the routemap, use the "allow" or "restrict" arguments.

restrict

Routes that match the routemap are not allowed.

Configuring Actions for a Routemap

Syntax:

Note - Some statements affect only a particular protocol (see Supported Route Map Statements by Protocol). The same parameter cannot appear both as a match and action statement in a routemap. These include Community, Metric, and Nexthop.

set routemap <Name of Routemap> id {<1-65535> | default} action

      aspath-prepend-count <1-25>

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

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

            no-export [{off | on}]

            no-advertise [{off | on}]

            no-export-subconfed [{off | on}]

            none [{off | on}]

      localpref <1-65535>

      metric {add | subtract} <1-16>

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

      metric value <1-4294967295>

      nexthop ip <IPv4 Address>

      precedence <1-65535>

      preference <1-65535>

      route-type <type-1 | type-2>

      remove <Name of Attribute>

      ospfautomatictag <0-4095>

      ospfmanualtag <1-4294967295>

      riptag <1-65535>

Parameters:

Parameter

Description

routemap <Name of Routemap>

Specifies the name of the routemap.

id {<1-65535> | default}

Specifies the ID of the routemap.

You can enter the keyword default or the default value 10.

aspath-prepend-count

Specifies to affix AS numbers at the beginning of the AS path.

It indicates the number of times the local AS number should be prepended to the ASPATH before sending out an update.

Applies only to BGP.

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

Operate on a BGP community string. A community string can be formed using multiple community action statements.

You can specify keywords append, replace, or delete for the kind of operation to be performed using the community string.

The default operation is append.

Applies only to BGP.

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

Specifies a BGP community value.

community no-export [{off | on}]

Routes received that carry a communities attribute containing this value must not be advertised outside a BGP confederation boundary (a stand-alone autonomous system that is not part of a confederation should be considered a confederation itself)

community no-advertise [{off | on}]

Routes received that carry a communities attribute containing this value must not be advertised to other BGP peers.

community no-export-subconfed [{off | on}]

All routes received carrying a communities attribute containing this value MUST NOT be advertised to external BGP peers (this includes peers inside a BGP confederation that belong to the autonomous systems of other members).

community none [{off | on}]

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.

Using it with append or delete would be a no-operation.

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

localpref <1-65535>

Set the local preference for BGP route.

Applies only to BGP.

metric [{add | subtract}]
<1-16>

Add to or subtract from the metric value.

Applies only to RIPv1.

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

Set metric to IGP metric value or add to or subtract from the IGP metric value.

Applies only to RIPv1.

metric value <1-4294967295>

Set the metric value.

Protocol metrics:

  • For RIP - metric

  • For OSPF - cost

  • For BGP - MED

nexthop ip IPv4 Address>

Set IPv4 Nexthop Address.

Applies only to BGP.

precedence <1-65535>

Sets the rank of the route. Precedence works across protocols.

Use this setting to bias routes of one protocol over the other.

The lower value has priority.

preference <1-65535>

This is equivalent to the BGP weight (in Cisco terms) of the route.

However, unlike Cisco, the route with lower value will be preferred.

This value is only relevant for the local router.

Applies only to BGP.

route-type
<type-1 | type-2>

Type of OSPF external route.

The metric type of AS External route is set to the specified value.

Applies only to routes redistributed to OSPF.

remove Name of Attribute

Remove the specified action from the routemap.

For community, it removes all community statements.

Accepted values are:

  • aspath-regex

  • community

  • ifaddress

  • interface

  • metric

  • neighbor

  • network

  • nexthop

  • protocol

  • route-type

ospfautomatictag <0-4095>

Configures the automatic tag for OSPF external routes that match the Route Map.

This action only applies when you export non-OSPF routes into OSPF with the "export-routemap" command.

See RFC 1403 for more information on OSPF tags.

ospfmanualtag <1-4294967295>

Configures the manual tag for OSPF external routes that match this Route Map ID.

This action only applies when you export non-OSPF routes into OSPF with the "export-routemap" command.

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 the "export-routemap" command.

See RFC 2453 for more information on RIP tags.

Configuring the Criteria that must be Matched for the Routemap to Take Effect

Syntax:

Note - Some statements affect only a particular protocol (see Supported Route Map Statements by Protocol). The same parameter cannot appear both as a match and action statement in a routemap. These include Community, Metric, and Nexthop.

set routemap <Name of Routemap> id <1-65535> match

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

      aspath-regex [{"<Regular Expression>" | empty}] origin {any | igp | incomplete}

      community

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

            exact [{off | on}]

            no-export [{off | on}]

            no-advertise [{off | on}]

            no-export-subconfed [{off | on}]

            none [{off | on}]

      ifaddress <IPv4 Address> [{off | on}]

      interface <Name of Interface> [{off | on}]

      metric value <1-4294967295>

      neighbor <Neighbor IPv4 Address> [{off | on}]

      network <Network IPv4 Address>/<Masklength>

            {all | exact | off | refines}

            between <Masklength_1> and <Masklength_2>

      nexthop <IPv4 Address>

      [{off | on}]

      protocol {ospf2 | ospf2ase | bgp | rip | static | direct | aggregate}

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

      remove <Name of Match Condition>

Parameters:

Parameter

Description

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

Match the specified autonomous system number with the AS number of a BGP peer.

Applies only to BGP.

aspath-regex [{"<Regular Expression>" | empty}] origin {any | igp | incomplete}

Match the specified ASpath regular expression.

Note - You must enter the regular expression in quotation marks.

Use the empty keyword to match a null ASpath.

Applies only to BGP.

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

Specify the BGP community value.

community exact [{off | on}]

Specify that the communities present in the route must exactly match all the communities in the routemap.

In absence of the exact clause, the route can have other community values associated with it in addition to the ones contained in the routemap.

You can have multiple community statements in a route map to form a community string.

community no-export [{off | on}]

All routes received that carry a communities attribute containing this value must not be advertised outside a BGP confederation boundary (a stand-alone AS that is not part of a confederation should be considered a confederation itself).

community no-advertise [{off | on}]

All routes received carrying a communities attribute containing this value must not be advertised to other BGP peers.

community no-export-subconfed [{off | on}]

All routes received carrying a communities attribute containing this value must not be advertised to external BGP peers (this includes peers in other members autonomous systems inside a BGP confederation).

community none [{off | on}]

Matches an empty community string, i.e. a route which does not have any communities associated with it.

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

ifaddress <IPv4 Address> [{off | on}]

Match the specified interface address.

There can be multiple if address statements.

interface <Name of Interface> [{off | on}]

Match the route if the nexthop lies on the specified interface name.

There can be multiple interface statements.

metric value <1-4294967295>

Match the specified metric value.

neighbor <Neighbor IPv4 Address> [{off | on}]

Match the neighbors IP address.

There can be multiple neighbor statements.

Applies only to BGP and RIPv1.

network <Network IPv4 Address>/<Masklength> {all | exact | off | refines}

Match the network as specified:

  • all

    Match all networks belonging to this prefix and masklength.

  • exact

    Match prefix exactly.

  • off

    Delete the network match statement.

  • refines

    Match networks with more specific mask lengths only. Matches only subnets.

  • between <Masklength_1> and <Masklength_2>

    Specify a range of masklengths to be accepted for the specified prefix.

There can be multiple network match statements in a route map.

nexthop <IPv4 Address>

Match the specified nexthop address.

protocol {ospf2 | ospf2ase | bgp | rip | static | direct | aggregate}

Match the specified protocol. Use this for route redistribution.

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

As a match statement in routemap for export policy, it can be used by any protocol to redistribute OSPF routes.

If you specify "inter-area" or "intra-area", then set the protocol match condition to "ospf2".

If you specify "type-1" or "type-2", then set the protocol match condition to "ospf2ase".

While exporting OSPF ASE routes to other protocol, if metric match condition is set but the "route-type" match condition is not set, it tries to match the metric value for both "type-1" and "type-2" routes.

There can be multiple route-type match statements.

remove <Name of Match Condition>

Remove the specified match condition from the routemap.

For match conditions which can have multiple match statements (such as network, neighbor), this argument removes all of them.