Different default metric for IPv6 routes when ip and route commands are used

Solution Verified - Updated -

Issue

If a IPv6 route is specified without any metric the value for it is different using ip command and route command.

Let's try to setup a default GW as en example below:

Using route command from net-tools rpm package the default metric is 1

# ip -6 r show | grep default

# route add -A inet6 default gw XXXX:YYYY::ZZZ dev ethX

# ip -6 r show  | grep default
default via XXXX:YYYY::ZZZ dev ethX metric 1 

Using ip command from iproute2 rpm package the default metric is 1024

# ip -6 r show  | grep default

# ip -6 route add default via XXXX:YYYY::ZZZ dev ethX

# ip -6 r show  | grep default
default via XXXX:YYYY::ZZZ dev ethX metric 1024 

Why the metric is not the same in both cases?

Environment

  • Red Hat Enterprise Linux 7
  • IPv6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content