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.

Advertisement

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

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

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. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.