To associate a metric value with an IPv4 route, include the metric statement:
-
static (defaults | route) {
-
metric metric <type type>;
- }
To associate a metric value with an IPv6 route, include the metric statement:
-
rib inet6.0 static (defaults | route) {
-
metric metric <type type>;
- }
For a list of hierarchy levels at which you can include these statements, see the statement summary sections for these statements.
In the type option, you can specify the type of route. For OSPF, when routes are exported to OSPF, type 1 routes are advertised in type 1 externals, and routes of any other type are advertised in type 2 externals. Note that if a qualified-next-hop metric value is configured, this value overrides the route metric.