Permanent route


I have rocky 9 and would like to add a few permanent routes, using

/sbin/ip route add via

It works but it doesn’t survive a reboot. Am I using the correct syntax to add permanent routes?

Thank you for your help.


The network connections are managed by NetworkManager (NM).
You have to tell the NM about the static route; NM will store it in its config.

What is the name of the connection that knows about Check with:

ip ro
nmcli c s

If it is “XYZ”, then one can:

sudo nmcli con mod XYZ +ipv4.routes ""


Thank you for pointing me to the right direction. I just tried

nmcli con mod enp0s31f6 +ipv4.routes “”

No errors are returned, which would make you think that the route has been added, however when I check if it is there, with ip r, I do not see it.

I don’t need to reboot, do I?

Thank you

I’d reload the connection:

sudo nmcli con down enp0s31f6
sudo nmcli con up enp0s31f6

or – if that does not do it – restart NM:

sudo systemctl restart NetworkManager

Thanks a lot jlehtone

It worked.