What is route metric?
The term metric as applied to networking, is used to assign priority to network routes. The higher the metric, the lower the priority of the route.
To set route metric in RHEL without NetworkManager
1. The correct way to set the route metric under CentOS/RHEL 7 is to modify the appropriate ifcfg-[interface] file located in /etc/sysconfig/network-scripts/ directory where [interface] is the name of the interface the metric is related to. A directive similar to the following should be added:
2. The network service must be restarted for changes to take effect:
# systemctl restart network
To set route metric in RHEL with NetworkManager
Use nmcli, nmtui, or the GUI tools to modify connection route Metric value.
1. To add a route metric with nmcli, modify the connection’s ipv4.route-metric property. For example, to add a route metric 600 for a connection named external:
# nmcli connection modify external ipv4.route-metric 600
2. After any of the modifications above, bring the connection up to put the changes into place. For example, after having modified the properties of a connection named external:
# nmcli connection up external