Network interface metrics¶
A metric is a value that is assigned to an IP route for a particular network interface. It identifies the cost that's associated with using that route.
Typically, the interface metric gives preference to a particular interface, such as using wired if both wired and wireless are available.
The eManager has different types of interfaces, each one with a different metric defined:
- Wifi
- PPP
- Ethernet
If the eManager has more than one interface enabled, Internet traffic will go through the interface with the lowest metric. For example, if the eManager can access Internet by Wifi, PPP or ethernet, it will go through the Wifi since it is the one with the lowest metric.
If you have any preference regarding the connectivity method to access Internet, you only have to change the metric of the desired method.
How to change the network interface metric¶
If you want to change the metric of any interface, you can follow these steps:
Step 1. Modify the interface configuration files
You must access the following configuration files and modify the metric field with the desired metric value:
Ethernet Interface:
/etc/systemd/network/20-eth0.network
Wifi Interface:
/etc/systemd/network/21-wlan0.network
PPP Interface:
/etc/ppp/options-mobile
Step 2. Restart the service
For Wifi and Ethernet interfaces you can use:
systemctl restart systemd-networkd
For PPP interface you can use:
systemctl restart ppp@provider.service
Step 3. Check the new metrics
You can check the new metrics value using one of the following commands:
route -n
ip r