Post

Changing a Network Metric with nmcli

If running two or more network cards, and one of the cards is taking priority over another one, the network metric needs to be changed.

Example. If one network cards has a public IP address and the other a private. If the public address takes priority, machines that live on the private networks may or may not be able to communicate with the machine.

Check the routes on the machine

Before making any changes, confirm that it is indeed an issue with the routes. Confirm with traceroute to see how the machine is trying to connect to another machine. Use route -n to check the defaults and what the current metrics are.

Get a list of your connections

nmcli connection

Editing the connection

nmcli connection edit connection_name

If the connection name has a space in it, include \ before using the space. Example: Profile\ 1

The connection edit will bring up an internal little progam that allows you to make changes to the connection.

Changing the metric.

set ipv4.route-metric ###
save
quit

Restart the network manager

sudo systemctl restart NetworkManager

Confirm

Use route -n to confirm that the route metric has changed. You should be able to now connect to the machine in question.

This post is licensed under CC BY 4.0 by the author.