0

In Ubuntu, I'm currently changing the metrics of these two interfaces manually:

$ sudo ifmetric wlan0 0
$ sudo ifmetric eth0  100

This works, but I need to accomplish this automatically on startup. ifmetric requires sudo, so I can't add a job with crontab. The command doesn't work after reboot.

I also tried editing /etc/rc.local with the above commands. This also doesn't work.

  • The root user also has a `crontab`, and you could configure `/etc/sudoers` not to need a password for that command. But you might change that at the interface configuration level. – Eduardo Trápani Aug 10 '21 at 02:48
  • Does this answer your question? [Set routing metrics for static IPs with systemd-networkd?](https://unix.stackexchange.com/questions/554107/set-routing-metrics-for-static-ips-with-systemd-networkd) – Eduardo Trápani Aug 10 '21 at 02:48

0 Answers0