# `VintageNet.Route.DefaultMetric`
[🔗](https://github.com/nerves-networking/vintage_net/blob/v0.13.7/lib/vintage_net/route/default_metric.ex#L6)

Default module for prioritizing network interfaces

The priority order is:

1. Internet-connected interfaces are chosen before LAN-connected interfaces
2. Wired Ethernet, then wifi, then mobile and then any other interfaces
3. The interface's weight is used to resolve ties. By default, the weight is
   derived from the interfaces index. E.g., `eth0`'s weight is 0 (highest priority)
   and `eth1`'s weight is 1 (next highest)

# `compute_metric`

```elixir
@spec compute_metric(VintageNet.ifname(), VintageNet.Route.InterfaceInfo.t()) ::
  VintageNet.Route.metric() | :disabled
```

Compute the routing metric for an interface with a status

This uses the prioritization list to figure out what number should
be used for the Linux routing table metric. It could also be `:disabled`
to indicate that a route shouldn't be added to the Linux routing tables
at all.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
