View Source VintageNet.Route.DefaultMetric (vintage_net v0.13.5)
Default module for prioritizing network interfaces
The priority order is:
- Internet-connected interfaces are chosen before LAN-connected interfaces
- Wired Ethernet, then wifi, then mobile and then any other interfaces
- 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) andeth1
's weight is 1 (next highest)
Summary
Functions
Compute the routing metric for an interface with a status
Functions
@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.