Setting network device priority with nmcli in Fedora

1.9k Views Asked by At

I am on Fedora v33 Server edition (no GUI) and I have setup 2 network connections. One is Ethernet, which I use to connect my Macbook to the Linux machine, the other is the WLAN connection the machine uses to connect to the internet.

So now whenever I do

nmcli con up eno1

I lose access to the Internet (ping www.google.com does not return any packets)

When the ethernet is down everything works, but I cannot use ethernet obviously.

Something similar can happen on a Mac OS where I can simply "drag" a network to set the priority. How do I do the same using only the terminal on a unix system like Fedora?

1

There are 1 best solutions below

0
On BEST ANSWER

Ok after some research I ran into this great tool called nmtui

sudo dnf install NetworkManager-tui

And after installing the tool and running it with sudo nmtui I edited my ethernet connection and saw the option called Never use this network for default route which translates to the option never-default=true inside the [ipv4] in the /etc/NetworkManager/system-connections/ config file.

After that I ran sudo nmcli con down eno1 && sudo nmcli con up eno1 and after running nmcli again I can see that the order of connections charged, where now my WLAN is first and my ethernet connection is second.