1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

route.8: Describe metric modifier

Describe `-metric` argument in the route manual.

Discussed with:	ziaee
Differential Revision: https://reviews.freebsd.org/D57025
This commit is contained in:
Pouria Mousavizadeh Tehrani
2026-05-16 01:32:09 +03:30
parent 2e2d402d06
commit d87e5b28b7
+21 -1
View File
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 16, 2026
.Dd May 17, 2026
.Dt ROUTE 8
.Os
.Sh NAME
@@ -308,6 +308,26 @@ and
.Dq Fl gateway Ar 3fff::2 Fl weight Ar 200
will make the nexthop 3fff::2 twice as likely to be chosen as 3fff::1.
.Pp
The
.Fl metric
option sets the numeric cost associated with a route nexthop.
The lowest metric is always preferred and routes with higher metric
values are only used if lower-metric routes become unavailable.
This allows routes to establish primary and backup nexthops without
removing the primary.
The default value for
.Fl metric
is 1 when not specified.
When multiple routes to the same destination have identical metrics, the
.Fl weight
option determines which nexthop is selected for ECMP.
.Pp
For example, a destination with two nexthops defined as
.Dq Fl gateway Ar 3fff::1 Fl metric Ar 1
and
.Dq Fl gateway Ar 3fff::2 Fl metric Ar 2
will cause the nexthop 3fff::1 to be selected.
.Pp
Routes have associated flags which influence operation of the protocols
when sending to destinations matched by the routes.
These flags may be set (or sometimes cleared)