LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ifmetric

manipulates IPv4 route metrics for network interfaces

TLDR

Set the priority of a network interface (higher number = lower priority)
$ sudo ifmetric [interface] [value]
copy
Reset the priority of an interface to default
$ sudo ifmetric [interface] 0
copy
Prefer wired over wireless by giving wireless a higher metric
$ sudo ifmetric wlan0 100
copy

SYNOPSIS

ifmetric interface metric

DESCRIPTION

ifmetric manipulates IPv4 route metrics for network interfaces. Route metrics determine which interface is preferred when multiple routes to the same destination exist - lower metric values have higher priority.This is useful for systems with multiple network connections (e.g., wired and wireless) where you want to control which connection is preferred for outgoing traffic.

PARAMETERS

interface

Name of the network interface (e.g., eth0, wlan0)
metric
Route metric value (higher values mean lower priority, 0 resets to default)

INSTALL

sudo apt install ifmetric
copy
nix profile install nixpkgs#ifmetric
copy

CAVEATS

Requires root privileges. Only affects IPv4 routes. Changes are not persistent across reboots unless scripted. Does not work with IPv6 routes.

HISTORY

ifmetric was created by Lennart Poettering (who later created PulseAudio and systemd) to provide a simple way to manipulate routing metrics without complex ip route commands.

SEE ALSO

ip(8), route(8), ifconfig(8), ifup(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid