Red Hat / CentOS Setup Routing Metric For Network Device

Q. How do I set the routing metric on my network device under Fedora / RHEL / Red Hat / CentOS Linux server / workstation operating system?

A. Routing is the process of selecting paths in a network along which to send network traffic. Path selection involves applying a routing metric to multiple routes, in order to select (or predict) the best route. 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.

ADVERTISEMENTS

Open your network interface configuration file for eth0 – /etc/sysconfig/network-scripts/ifcfg-eth0, type:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Add / append the following line:
METRIC=xyz
Replace xyz with actual with actual metric number. Save and close the file. Restart the network service:
# /etc/init.d/networking restart

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • Arindam Apr 12, 2012 @ 1:00

    Just what I needed. Thank u for posting this.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.