Hi Cube

Maximum route metric on Linux

Ever wondered what is the maximum route metric value you can configure on Linux? man interface and man ip state that route metric is a number, but don’t specify its range.

# ip route add via metric 0
# ip route add via metric 4294967295
# ip route add via metric 4294967296
Error: argument "4294967296" is wrong: "metric" value is invalid

# ip route via dev eth0 via dev eth0  metric 4294967295

It looks like Linux route metric is an unsigned 32-bit integer, ranging from 0 to 4294967295. As you already know a route with the lowest metric is preferred.

Post navigation

Leave a Reply