Route Prioritizing

A metric is a weighted cost assigned to static and dynamic routes. Metrics have a value between 1 and 254. Lower metrics are considered better and take precedence over higher costs. SonicOS adheres to Cisco-defined metric values for directly connected interfaces, statically encoded routes, and all dynamic IP routing protocols.

 

Metric Value Descriptions

Metric Value

Description

1

Static Route

5

EIGRP Summary

20

External BGP

90

EIGRP

100

IGRP

110

OSPF

115

IS-IS

120

RIP

140

EGP

170

External EIGRP

Internal

BGP

Traditionally, routes have been prioritized based on the specificity of the destination IP address. Routes with longer prefixes (more specific) have a higher priority than routes with shorter prefixes (less specific).

With the metric-based policy routing, three additional fields are used to prioritize a route:

The general prioritization of policy routing (from high to low) is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Within these 15 classifications, routes are further prioritized based on the cumulative specificity of the defined route entries. For the source and destination fields, specificity is measured by counting the number of IP addresses represented in the address object.

For example, the network address object 10.0.0.0/24 represents 256 IP addresses, while the network address object 10.0.0.0/20 represents 4096 IP addresses. The longer /24 prefix represents fewer host IP addresses and is more specific. Range address objects have (end - begin + 1) IP addresses.

For example, routes with only the destination defined are prioritized based on the cumulative number of host IP addresses, represented by their destination address objects. The routes with a smaller number of host addresses are more specific than those with a greater number, and are prioritized accordingly. The metric comes into play only if two or more of the routes have an identical number of host IP addresses represented by their destinations.

The metric-weighted prioritization option takes precedence over the route specificity prioritization.