How to make Metric

Issues related to configuring your network
Post Reply
zemzema
Posts: 2
Joined: 2019/12/20 09:09:40

How to make Metric

Post by zemzema » 2019/12/20 09:17:00

Hello,

for couple of days I trying to make metric command work in route-eth0 but without any success.

I disabled NetworkManager, and configured everything manually.

Configuration for ifcfg-eth0 is:

TYPE=Ethernet
BOOTPROTO=static
IPV6INIT=no
NAME=eth0
UUID=5faa96ff-6037-4733-9952-35f7beee2e34
DEVICE=eth0
ONBOOT=yes
IPADDR=10.10.2.211
PREFIX=24
GATEWAY=10.10.2.1
DNS=8.8.8.8
NM_CONTROLLED=no
USERCTL=no


Configuration in route-eth0 is:
METRIC0=800
ADDRESS0=10.168.10.5
NETMASK0=255.255.255.255
GATEWAY0=10.10.2.1


RESULT:
------------------------------------------------------
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.10.2.1 0.0.0.0 UG 0 0 0 eth0
10.10.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.168.10.5 10.10.2.1 255.255.255.255 UGH 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0


Some help please!

User avatar
TrevorH
Forum Moderator
Posts: 28033
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to make Metric

Post by TrevorH » 2019/12/20 09:59:57

I suspect that the reason it doesn't work is because there is no METRICn= documented in /usr/share/doc/initscripts-9.49.47/sysconfig.txt. There is only METRIC= and it says it applies to the default route.

Also, what are you trying to do? The route you're adding is also pointing to the default route that exists so I don't think it serves any purpose.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

zemzema
Posts: 2
Joined: 2019/12/20 09:09:40

Re: How to make Metric

Post by zemzema » 2019/12/20 11:14:27

This was just example, to check on simple setup to test METRIC.

aks
Posts: 2958
Joined: 2014/09/20 11:22:14

Re: How to make Metric

Post by aks » 2019/12/21 07:25:37

Routing metrics only apply to routes - not interfaces. As Trevor said, metrics applied to an interface applies only to the default route.

What are you trying to do? If you want to load balance or favour some interface over another, then you should be looking at bonding.

Post Reply

Return to “CentOS 7 - Networking Support”