C H A P T E R 18

Route Map

The route map feature provides a set of rules to control route redistribution. Before a route is redistributed from one routing domain to another, it is checked against a set of rules. If a rule matches, permit or deny access control is applited to the route. The route map feature also permits modification of route information during redistribution. Use this feature to set conditions with the match clause and set actions with the set clause.

Note - The CLI commands for the route map are applicable only for RIP.

Note - The `route-map` command enters the route map configuration mode.

##

18.1 Route Map Commands

The list of CLI commands for the configuration of route map is as follows:

- route-map

- match interface

- match ip address

- match ip next-hop

- match metric

- match tag

- match route-type

- match metric-type

- match as-path tag

- match community-list

- match origin

- match local-preference

- set interface

- set as-path tag

- set community

- set local-preference

- set origin

- set tag

- set ip next-hop

- set metric-type internal | external

- set metric-type type-1 | type-2

- set metric

- show route-map

### 18.1.1 `route-map`

Creates a route map with name, sequence number and associated access type. The command also enters the route map configuration mode. The `no` form of the command removes the specified sequence number from route-map.

    route-map name_1-20 [{permit | deny}] [seqnum_1-10]

    no route-map name_1-20 [{permit | deny }] [seqnum_1-10]

Syntax Description | name - Identifies the specified route-map in the list of route-maps. The length ranges from 1 to 20. permit - Allows the redistribution of the route. This parameter is currently not supported in the `no` form of the command. deny - Denies the redistribution. This parameter is currently not supported in the `no` form of the command. seqnum - Indicates the position of a new route map in the list of route maps already configured with the same name. The range of the sequence number is from 1 to 10.
Mode | Global Configuration
Default | permit | deny - permit seqnum - 1
Example | SEFOS(config)# route-map rmap-test
Notes | The `no route map` command deletes the complete route-map if the sequence number is not specified.

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.2 `match interface`

Matches the next hop interface of the route out of the specified interface. The `no` form of the command removes the match interface entry from the match entry list.

    match interface {vlan 1-4094 | interface-type interface-id}

    no match interface {vlan 1-4094 | interface-type interface-id}

Syntax Description | vlan - VLAN Identifier. The range of the identifier is from 1 to 4094. interface-type - Specifies the type of the interface. interface-id - Interface identifier.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match interface vlan 1

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.3 `match ip address`

Matches the route that have a destination network address against the permitted range of addresses. The `no` form of the command removes the match IP address entry from the match entry list.

    match ip address destination-ip-addr net mask

    no match ip address destination-ip-addr net mask

Syntax Description | destination-ip-addr - Specifies the destination network number address. netmask - Specifies the mask that provides the range of the network addresses.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match ip address 25.0.0.0 255.0.0.0
Notes | The destination IP address provides the range of addresses that matches the route-map when logically `AND`ed with the mask.

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.4 `match ip next-hop`

Matches the routes having the specified next-hop address. The `no` form of the command removes the match IP next-hop entry from the match entry list.

    match ip next-hop next-hop_ip-addr

    no  match ip next-hop next-hop_ip-addr

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match ip next-hop 12.0.0.10

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.5 `match metric`

Matches the given metric with the metric specified in the route-map. The `no` form of the command removes the match metric entry from the match entry list.

    match metric 1-0x7fffffff

    no match metric 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match metric 2000

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.6 `match tag`

Matches the given tag with the tag specified in the route-map. The `no` form of the command removes the match tag entry from the match entry list

    match tag 1-0x7fffffff

    no match tag 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match tag 2020

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.7 `match route-type`

Matches the specified route-type with that of in route-map. The `no` form of the command removes match route-type entry from match entry list.

    match route-type {local | internal | external {type-1 |type-2}}

    no match route-type {local | internal |external {type-1 | type-2}}

Syntax Description | local - Matches the connected routes. internal - Matches the static routes. type-1 - OSPF external type 1 metric. Cost from the router to ASBR (Autonomous Border System Router) and cost from ASBR to destination are included when route calculation is done for a destination. external - Matches the external routes of the routing domain. type-2 - OSPF external type 2 metric. Cost from the router to ASBR is included when route calculation is done for a destination.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match route-type external type-1

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.8 `match metric-type`

Matches the metric type of a given route with the specified metric type. The `no` form of the command removes match metric-type entry from match entry list

    match metric-type {internal | external {type-1 | type-2}}

    no match metric-type {internal | external {type-1 | type-2}}

Syntax Description | internal - Matches the static or connected metric type. type-1 - OSPF external type 1 metric. Cost from the router to ASBR (Autonomous Border System Router) and cost from ASBR to destination are included when route calculation is done for a destination. external - Matches the external metric type. type-2 - OSPF external type 2 metric. Cost from the router to ASBR is included when route calculation is done for a destination.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match metric-type internal

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.9 `match as-path tag`

Matches the AS path tag of the route with the existing AS-path in BGP. The `no` form of the command removes match AS-path entry from the match entry list.

    match as-path tag 1-0x7fffffff

    no match as-path tag 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match as-path tag 2828
Notes | This command is applied only when redistributing routes into BGP.

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.10 `match community-list`

Matches the BGP communities attribute in the route with the specified community. The `no` form of the command removes the match community entry from the match entry list.

    match community-list {internet | local-as | no-advt | no-export | [comm-num] 1-0x7fffffff | none | string} [exact]

    no match community-list {internet | local-as | no-advt | no-export | [comm-num] 1-0x7fffffff | none}

Syntax Description | internet - Internet community. local-as - Local autonomous system community. no-advt - No-advertisement community. no-export - No export community. comm-num - Community number. none - No community. string - Name of the community list. match - Requires an exact match. That is, only the specified communities must be present.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match community-list internet
Notes | This command is applied only when redistributing routes into BGP.

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.11 `match origin`

Matches the origin of the route in BGP with the specified origin. The `no` form of the command removes the match origin entry from match entry list.

    match origin {igp | egp | incomplete}

    no match origin {igp | egp | incomplete}

Syntax Description | igp - Specifies that the route is originated through interior gateway protocol. egp - Specifies that the route is originated through exterior gateway protocol. incomplete - Specifies that the route is originated through unknown heritage.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# `match origin igp`

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.12 `match local-preference`

Matches a preference value for the autonomous system path. The `no` form of the command removes the match local-preference entry from the match entry list.

    match local-preference 1-0x7fffffff

    no match local-preference 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# match local-preference 2626

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.13 `set interface`

Sets the next hop interface of the route. The `no` form of the command removes the set interface entry from the set entry list.

    set interface {vlan 1-4094 | interface-type interface-id}

    no set interface {vlan 1-4094 | interface-type interface-id}

Syntax Description | vlan - VLAN identifier. The range of the identifier is from 1 to 4094 interface-type - Specifies the type of the interface. interface-id - Interface identifier.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set interface vlan 1

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.14 `set as-path tag`

Sets the tag to the existing AS-path in BGP. The `no` form of the command removes the set AS-path from the set entry list.

    set as-path tag 1-0x7fffffff

    no set as-path tag 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set as-path tag 2929

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.15 `set community`

Sets the BGP communities attribute in the route. The `no` form of the command removes the set community from the set entry list.

    set community {internet | local-as | no-advt | no-export | comm-num 1-0x7fffffff | none}

    no set community {internet | local-as | no-advt | no-export | comm-num 1-0x7fffffff | none}

Syntax Description | internet - Internet community. local-as - Local autonomous system community. no-advt - No advertisement community. no-export - No export community. comm-num - Community number. none - No community.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set community no-export

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.16 `set local-preference`

Specifies a preference value for the autonomous system path in the route. The `no` form of the command removes the set local-preference from the set entry list.

    set local-preference 1-0x7fffffff

    no set local-preference 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set local-preference 202020

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.17 `set origin`

Sets the origin of the route in BGP. The `no` form of the command removes the set origin from the set entry list.

    set origin  {igp | egp as-value_1-65535 | incomplete}

    no set origin {igp | egp as-value_1-65535 | incomplete}

Syntax Description | igp - Specifies that the route is originated through interior gateway protocol. egp - Specifies that the route is originated through exterior gateway protocol. incomplete - Specifies that the route is originated through unknown heritage.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set origin incomplete

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.18 `set tag`

Sets the tag value for BGP, OSPF, or RIP routing protocols in the given route. The `no` form of the command removes the `set` tag from the `set entry` list.

    set tag 1-0x7fffffff

    no set tag 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set tag 282828

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.19 `set ip next-hop`

Sets the next hop IP address of the route. The `no` form of the command removes the `set ip next-hop` from the set entry list.

    set ip next-hop next-hop_ip-addr

    no set ip next-hop next-hop_ip-addr

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set ip next-hop 12.0.0.2

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.20 `set metric-type internal | external`

Sets the value of metric type in the route. The `no` form of the command removes the set metric-type entry from the set entry list.

    set metric-type {internal | external {type-1 | type-2}}

    no set metric-type {internal | external {type-1 | type-2}}

Syntax Description | internal - Sets the static or connected metric type. external - Sets the external metric type. Options are as follows: type-1 - OSPF external type 1 metric. Cost from the router to ASBR (Autonomous Border System Router) and cost from ASBR to destination are included when route calculation is done for a destination. type-2 - OSPF external type 2 metric. Cost from the router to ASBR is included when route calculation is done for a destination.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set metric-type external type-2

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.21 `set metric-type type-1 | type-2`

Sets the value of external metric type in the route. The `no` form of the command removes the set metric type from the set entry list.

This command operates similar to that of the command set metric-type internal | external. However, with this command only the external metric type can be set.

    set metric-type {type-1 | type-2}

    no set metric-type {type-1 | type-2}

Syntax Description | type-1 - OSPF external type 1 metric. Cost from the router to ASBR (Autonomous Border System Router) and cost from ASBR to destination are included when route calculation is done for a destination. type-2 - OSPF external type 2 metric. Cost from the router to ASBR is included when route calculation is done for a destination.
Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set metric-type type-2

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.22 `set metric`

Sets the metric value in the route. The `no` form of the command removes the set metric entry from the set entry list.

    set metric 1-0x7fffffff

    no set metric 1-0x7fffffff

Mode | Route Map Configuration
Example | SEFOS(config-rmap-rmap-test)# set metric 400

#### Related Commands

- show route-map - Displays the configured route maps

### 18.1.23 `show route-map`

Displays the configured route maps.

    show route-map [name 1-20]

Mode | Privileged EXEC
Example | SEFOS# sh route-map Route-map rmap-test, Permit, Sequence 1 Match Clauses: -------------- LocalPreference 2626 Origin igp Community internet ASPath 2828 MetricType internal RouteType external type-1 Tag 2020 Metric 2000 NextHop 12.0.0.10 Dest N/W 25.0.0.0 Interface vlan1 Set Clauses: ----------- Interface vlan1 NextHop 12.0.0.2 Metric 400 As-Path 2929 Tag 282828 MetricType external type-2 Community no-export Origin incomplete Local Preference 202020
| SEFOS# sh route-map rmap-test Route-map rmap-test, Permit, Sequence 1 Match Clauses: -------------- LocalPreference 2626 Origin igp Community internet ASPath 2828 MetricType internal RouteType external type-1 Tag 2020 Metric 2000 NextHop 12.0.0.10 Dest N/W 25.0.0.0

#### Related Commands

- route-map - Creates a route-map with name, sequence number, and associated access type

- match interface - Matches next hop interface of the route out of the specified interface

- match ip address - Matches the route that have a destination network address against the permitted range of addresses

- match ip next-hop - Matches the routes having the specified next hop address

- match metric - Matches the given metric with the metric specified in the route-map

- match tag - Matches the given tag with the tag specified in the route-map

- match route-type - Matches the specified route-type with that of in route-map

- match metric-type - Matches the metric type of a given route with the specified metric type

- match as-path tag - Matches the AS path tag of the route with the existing AS-path in BGP

- match community-list - Matches the BGP communities attribute in the route with the specified community

- match origin - Matches the origin of the route in BGP with the specified origin

- match local-preference - Specifies a preference value for the autonomous system path in the route

- set interface - Sets the next hop interface of the route

- set as-path tag - Sets the tag to the existing AS-path in BGP

- set community - Sets the BGP communities attribute in the route

- set local-preference - Specifies a preference value for the autonomous system path in the route

- set origin - Sets the origin of the route in BGP

- set tag - Sets the tag value for BGP, OSPF, or RIP routing protocols in the given route

- set ip next-hop - Sets the next hop IP address of the route

- set metric-type internal | external - Sets the value of metric type in the route

- set metric-type type-1 | type-2 - Sets the value of external metric type in the route

- set metric - Sets the metric value in the route

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.