Route Policy Definition

You can define an IP route policy and its attributes globally, and then apply them individually to interfaces and protocols. You can also form a unified database of route policies that the RIP or OSPF protocol can use for type of filtering purpose. A name or ID identifies a policy.

Under a policy you can have several sequence numbers. If you do not configure a field in a policy, the system displays the field as 0 in CLI show command output. This value indicates that the device ignores the field in the match criteria. Use the clear option to remove existing configurations for the field.

Each policy sequence number contains a set of fields. Only a subset of those fields is used when the policy is applied in a certain context. For example, if a policy has a configured set-preference field, it is used only when the policy is applied for accept purposes. This field is ignored when the policy is applied for announce or redistribute purposes.

You can only apply one policy for each purpose (RIP Announce, for example) on a given RIP interface. In this case, all sequence numbers under the policy apply to that filter. A sequence number also acts as an implicit preference; a lower sequence number is preferred.

The following tables display the accept, announce, and redistribute policies for RIP, OSPF, IS-IS and BGP. The tables also display which matching criteria apply for a certain routing policy. In these tables, 1 denotes advertise router, 2 denotes RIP gateway, and 3 denotes that external type 1 and external type 2 are the only options.

Note

Note

The route policies treat permit and deny rules differently for inbound and outbound traffic.
  • For an in-policy (RIP, BGP) or an accept policy (OSPF) using a route-map, if a particular route is not explicitly denied in the accept policy or in-policy with the route-map, then the route is implicitly allowed.

  • For an out-policy (RIP, BGP) or a redistribute policy (RIP, OSPF, BGP) using a route-map, even if a particular route is not explicitly allowed in the redistribution policy or out-policy with the route-map, then the route is implicitly denied.

  • In order to permit or deny only explicit routes, configure a policy with additional sequences, where, the last sequence permits all routes that are not explicitly permitted or denied.

Note

Note

IPv4 and IPv6 route-maps cannot be configured on the same match statement.

Table 1. Protocol route policy table for RIP

Announce

Accept

OSPF

Direct

RIP

BGP

RIP

Match Protocol

Yes

Yes

Yes

Yes

Match Network

Yes

Yes

Yes

Yes

Yes

Match IpRoute Source

Yes1

Yes2

Match NextHop

Yes

Yes

Yes

Yes

Yes

Match Interface

Yes

Match Route Type

Yes

Match Metric

Yes

Yes

Yes

Yes

Yes

MatchAs Path

Match Community

Match Community Exact

MatchTag

Yes

NssaPbit

SetRoute Preference

Yes

SetMetric TypeInternal

SetMetric

Yes

Yes

Yes

Yes

Yes

SetMetric Type

SetNextHop

SetInject NetList

Yes

Yes

Yes

Yes

Yes

SetMask

Yes

SetAsPath

SetAsPath Mode

Set Automatic Tag

Set CommunityNumber

Set CommunityMode

SetOrigin

SetLocal Pref

SetOrigin EgpAs

SetTag

SetWeight

Table 2. Protocol route policy table for OSPF

Redistribute

Accept

Direct

Static

RIP

BGP

IS-IS

OSPF

Match Protocol

Yes

Yes

Match Network

Yes

Yes

Yes

Yes

Yes

Yes

Match IpRoute Source

Yes2

Match NextHop

Yes

Yes

Yes

Match Interface

Yes

Match Route Type

Yes3

Match Metric

Yes

Yes

Yes

Yes

Yes

Yes

MatchAs Path

Match Community

Match Community Exact

MatchTag

Yes

Set NSSA Bit

Yes

Yes

Yes

Yes

Yes

SetRoute Preference

SetMetric TypeInternal

SetMetric

Yes

Yes

Yes

Yes

Yes

Yes

SetMetric Type

Yes

Yes

Yes

Yes

Yes

SetNextHop

Yes

Set Inject NetList

Yes

Yes

Yes

Yes

Yes

Yes

SetMask

SetAsPath

SetAsPath Mode

Set Automatic Tag

Set CommunityNumber

Set CommunityMode

SetOrigin

SetLocal Pref

SetOrigin EgpAs

SetTag

SetWeight

Table 3. Protocol route policy table for IS-IS

Redistribute

Accept

Direct

Static

RIP

BGP

OSPF

Match Protocol

Yes

Yes

Yes

Yes

Yes

Match Network

Yes

Yes

Yes

Yes

Yes

Match IpRoute Source

Yes

Match NextHop

Yes

Yes

Yes

Yes

Match Interface

Yes

Match Route Type

Yes3

Match Metric

Yes

Yes

Yes

Yes

Yes

MatchAs Path

Match Community

Match Community Exact

MatchTag

Yes

Set NSSA Bit

SetRoute Preference

SetMetric Type Internal

SetMetric

Yes

Yes

Yes

Yes

Yes

SetMetric Type

Yes

Yes

Yes

Yes

Yes

SetNextHop

Yes

SetInject NetList

Yes

Yes

Yes

Yes

Yes

SetMask

SetAsPath

SetAsPath Mode

Set Automatic Tag

Set CommunityNumber

Set CommunityMode

SetOrigin

SetLocal Pref

SetOrigin EgpAs

SetTag

SetWeight

Table 4. Protocol route policy table for BGP

Redistribute

Accept

Announce

IPv6 Direct

IPv6 Static

OSPFv3

BGP

BGP

Match as-path

Yes

Yes

Match community

Yes

Yes

Yes

Yes

Yes

Match community-exact

Yes

Yes

Match extcommunity

Yes

Yes

Match interface

Match local-preference

Match metric

Yes

Yes

Yes

Yes

Yes

Match network

Yes

Yes

Yes

Yes

Yes

Match next-hop

Yes

Yes

Yes

Yes

Match protocol

Match route-source

Yes

Match route-type

Yes

Yes

Match tag

Match vrf

Match vrfids

Set as-path

Yes

Yes

Set as-path-mode

Yes

Yes

Set automatic-tag

Set community

Yes

Yes

Set community-mode

Yes

Yes

Set injectlist

Yes

Yes

Yes

Set ip-preference

Set local-preference

Yes

Yes

Set mask

Set metric

Yes

Yes

Yes

Yes

Yes

Set metric-type

Set metric-type-internal

Set next-hop

Yes

Yes

Set nssa-pbit

Set origin

Yes

Set origin-egp-as

Set Tag

Set Weight

Yes