Routemap Commands

ipv6 policy route-map

To set an interface to use policy-based routing (PBR) with IPv6, use the ipv6 policy route-map command in interface configuration mode. To clear the PBR, use the no form of this command.

ipv6 policy route-map string

no ipv6 policy route-map string

Syntax Description

string

Identifies a route map to be used for IPv6 PBR on an interface.

Command Default

None

Command Modes

interface configuration (config-if)

Command History

Release Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Command qualified for use in Cisco SD-WAN Manager CLI templates.

Usage Guidelines

To enable PBR for IPv6, create a route map that specifies the packet match criteria and the desired policy-route action. Then, associate the route map on the required interface. All packets arriving on the specified interface that match the match clauses will be subject to PBR.

Depending on your release, IPv6 PBR allows users to override normal destination IPv6 address-based routing and forwarding results. VPN routing and forwarding (VRF) allows multiple routing instances in Cisco software. The PBR feature is VRF-aware, which means that it works under multiple routing instances, beyond the default or global routing table.

Example

The following example configures PBR on GigabitEthernet 0/0/2, using the map tag “rip-to-ospf”

Device(config)# interface GigabitEthernet 0/0/2
Device(config-if)# ipv6 policy route-map rip-to-ospf

match ip address

To distribute any routes that have a destination IP network number address that is permitted by a standard access list, an expanded access list, or a prefix list, use the match ip address command. To remove the match ip address entry, use the no form of this command.

match ip address { prefix-list | [ prefix-list-name ] }

no match ip address { prefix-list | [ prefix-list-name ] }

Syntax Description

prefix-listprefix-list-name

Distributes routes based on a prefix list. The prefix list name can be any alphanumeric string up to 63 characters. The ellipsis indicates that multiple values can be entered, up to 32 prefix lists.

Command Default

No prefix lists are specified.

Command Modes


Route-map configuration mode (config-route-map)

Command History

Release

Modification

Cisco IOS XE Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

This example shows how to match routes that have addresses specified by an access list test:


Device(config)# route-map rmap1 deny 10
Device(config-route-map)# match ip address prefix-list prfx1

match length

To base policy routing on the Level 3 length of a packet, use the match length command in route-map configuration mode. To remove the entry, use the no form of this command.

match length minimum-length maximum-length

no match length minimum-length maximum-length

Syntax Description

minimum-length

Minimum Level 3 length of the packet allowed for a match. The range is from 0 to 2147483647.

maximum-length

Maximum Level 3 length of the packet allowed for a match. The range is from 0 to 2147483647.

Command Default

No policy routing occurs on the length of a packet.

Command Modes

Route-map configuration (config-route-map)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE match length command.

In the following example, packets 3 to 200 bytes long, inclusive, will be routed to FDDI interface 0:

Router(config)# interface Ethernet0/0
(config-router)# route-map interactive
Router(config-route-map) match length 3 200
Router(config-route-map) set interface fddi 0

route-map permit set default interface

To set the output interface for destinations that match the criteria in the route-map, if there is no explicit route to the destination, use the set default interface command in route-map configuration mode. To delete an entry, use the no form of this command.

route-map route-map permit value [ set default interface string ]

no route-map route-map permit value [ set default interface string ]

Syntax Description

route-map

A name specified for the specific route-map.

value

Sets the value of the permit or deny action of the route-map.

string

Interface type, and interface number, to which packets are forwarded. IE. GigabitEthernet, Tunnel.

Command Default

This command is disabled by default.

Command Modes

route map configuration (config-route-map)

Command History

Release Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Command qualified for use in Cisco SD-WAN Manager CLI templates.

Usage Guidelines

An ellipsis (...) in the command syntax indicates that your command input can include multiple values for the type and number arguments.

If the first interface specified with the set interface command is down, the optionally specified interfaces are tried in turn. If no other interface is specified, the default interface is then used.

Example

The following example configures the route-map “rip-to-ospf” to forward packets that pass the match criteria to the default interface of Tunnel1 if no other interface is specified.

Device(config)# route-map rip-to-ospf permit 79
Device(config-route-map)# set default interface Tunnel1

The following example configures the route-map “rip-to-ospf” to forward packets that pass the match criteria to the default interface of GigabitEthernet 3 if no other interface is specified.

Device(config)# route-map rip-to-ospf permit 56
Device(config-route-map)# set default interface GigabitEthernet 0/0/3

route-map permit set interface

To set the output interface for destinations that match the criteria in the route-map, use the set default interface command in route-map configuration mode. To delete an entry, use the no form of this command.

route-map route-map permit value [ set interface string ]

no route-map route-map permit value [ set interface string ]

Syntax Description

route-map

A name specified for the specific route-map.

value

Sets the value of the permit or deny action of the route map.

string

Interface type, and interface number, to which packets are forwarded. For example, GigabitEthernet or Tunnel.

Command Default

Packets that pass a match clause are not forwarded to an interface.

Command Modes

route map configuration (config-route-map)

Command History

Release Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Command qualified for use in Cisco SD-WAN Manager CLI templates.

Usage Guidelines

An ellipsis (...) in the command syntax indicates that your command input can include multiple values for the type and number arguments.

If the first interface specified with the set interface command is down, then the optionally specified interfaces are used instead.

Example

The following example configures the route-map “rip-to-ospf” to forward packets that pass the match criteria to interface Dialer1.

Device(config)# route-map rip-to-ospf permit 50
Device(config-route-map)# set interface Dialer1

The following example configures the route-map “rip-to-ospf” to forward packets that pass the match criteria to interface GigabitEthernet 2.

Device(config)# route-map rip-to-ospf permit 55
Device(config-route-map)# set interface GigabitEthernet 0/0/2

The following example configures the route-map “rip-to-ospf” to forward packets that pass the match criteria to interface tunnel1.

Device(config)# route-map rip-to-ospf permit 60
Device(config-route-map)# set interface Tunnel

route-map permit set ipv6 precedence

To set a IPv6 precedence value, use the set ipv6 precedence command in route map configuration mode. To clear the IPv6 precedence, use the no form of this command.

route-map route-map permit value set ipv6 precedence unsigned-byte

no route-map route-map permit value set ipv6 precedence unsigned-byte

Syntax Description

route-map

A name specified for the specific route-map.

value

Sets the value for the permit or deny action of the route map.

unsigned-byte

Sets precedence value in the ipv6 header.The range is from 0 to 7.

Command Default

None

Command Modes

route map configuration (config-route-map)

Command History

Release Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Command qualified for use in Cisco SD-WAN Manager CLI templates.

Usage Guidelines

When creating a route map that specifies the packet match criteria and desired policy-route action, you can specify the IPv6 precedence header value for the route-map policy.

Example

The following example configures IPv6 precedence value of 3 for the “rip-to-ospf” route map.

Device(config)# route-map rip-to-ospf permit 45
Device(config-route-map)# set ipv6 precedence 3
Table 1. Related Commands

Commands

Description

set ipv6 address

IPv6 address.

set ipv6 bvrf

Sets VRF instance selection within a route map for a policy-based routing VRF selection.

set ipv6 default

Sets default parameters for the policy.

set ipv6 global

Sets global parameters for the policy.

set ipv6 next-hop

Sets next hop to route the packet (the next hop must be adjacent).

route-map permit set vrf

To use a specific VRF table for Policy-based routing (PBR), use the route-map permit set vrf command in route map configuration mode. To remove the VRF from the route-map, use the no form of this command.

route-map route-map permit value set vrf string

Syntax Description

route-map

A name specified for the specific route-map.

value

Sets the value for the permit or deny action of the route map.

string

A name specified for a specific VRF.

Command Default

None

Command Modes

route map configuration (config-route-map)

Command History

Release Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Command qualified for use in Cisco SD-WAN Manager CLI templates.

Usage Guidelines

Use route-map permit set vrf command to route packets using a particular VRF table through any of the interfaces belonging to that VRF. If there is no route in the VRF table, the packets are dropped.

Example

The following example configures a VRF-aware PBR, using the map tag “rip-to-ospf”.

Device(config)# route-map rip-to-ospf permit 70
Device(config-route-map)# set vrf mgmt

route-map

To define conditions for redistributing routes from one routing protocol to another routing protocol, or to enable policy routing, use the route-map command in global configuration mode. To delete an entry, use the no form of this command.

route-map map-name [ permit | deny ] sequence-number

no route-map map-name [ permit | deny ] sequence-number

Syntax Description

map-name

Name for the route map.

permit

(Optional) Permits only routes matching the route map to be forwarded or redistributed.

deny

(Optional) Blocks routes matching the route map from being forwarded or redistributed.

sequence-number

(Optional) Number that indicates the position a new route map will have in the list of route maps already configured with the same name.

Command Default

Policy routing is not enabled and conditions for redistributing routes from one routing protocol to another routing protocol are not configured.

Command Modes

Global configuration (config)

Command History

Release

Modification

Cisco IOS XE Catalyst SD-WAN Release 17.2.1v

Command qualified for use in Cisco vManage CLI templates.

Usage Guidelines

For usage guidelines, see the Cisco IOS XE route-map command.

The following is an example for this command:


Device(config)# route-map ospf deny 10
Device(config)# route-map rip permit 10

The following example redistributes Routing Information Protocol (RIP) routes with a hop count equal to 1 into Open Shortest Path First (OSPF). These routes will be redistributed into OSPF as external link-state advertisements (LSAs) with a metric of 5, metric type of Type 1, and a tag equal to 1.

Router(config)# router ospf 109
Router(config-router)# redistribute rip route-map rip-to-ospf
Router(config-router)# exit
Router(config)# route-map rip-to-ospf permit
Router(config-route-map)# match metric 1
Router(config-route-map)# set metric 5
Router(config-route-map)# set metric-type type1
Router(config-route-map)# set tag 1

The following example for IPv6 redistributes RIP routes with a hop count equal to 1 into OSPF. These routes will be redistributed into OSPF as external LSAs with a tag equal to 42 and a metric type equal to type1.


Router(config)# ipv6 router ospf 1
Router(config-router)# redistribute rip one route-map rip-to-ospfv3
Router(config-router)# exit
Router(config)# route-map rip-to-ospfv3
Router(config-route-map)# match tag 42
Router(config-route-map)# set metric-type type1