I am trying to build a fallback connection for my ubuntu box on eth1 (it is actually a Huawei HiLink mobile broadband modem). This is the content of my interfaces file:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

auto eth1
allow-hotplug eth1
iface eth1 inet manual
    metric 400            # does not work

I am using dhcpcd as networkmanager. I have read that dhcpcd automatically sets the metric of ethernet devices to 200+ and of wlan devices to 300+. Here is my output of route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    202    0        0 eth0         UG    203    0        0 eth1         UG    304    0        0 wlan0   U     202    0        0 eth0   U     304    0        0 wlan0   U     203    0        0 eth1

Is it possible to change metric in dhcpcd elsewhere? Because in the interfaces file it simply does not work!


The configuration file for dhcpcd is /etc/dhcpcd.conf.
I just had to add these two lines:

interface eth1
metric 400

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.