NetworkManager is not able to delete routes

Hello,

I am trying to use NetworkManager (NM) to remove an Ethernet route from my system but it seems useless, using the following command:
nmcli connection modify network0 -ipv4.routes “0.0.0.0/0 192.168.18.1”

The route I am trying to remove can be seen with NM using the following command:
nmcli connection show network0

IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 192.168.18.1, mt = 100

, or by by the command ip route:
default via 192.168.18.1 dev ethernet0 proto static metric 100 <-----This one
default via 100.78.208.8 dev wwan0 proto static metric 700
100.78.208.0/28 dev wwan0 proto kernel scope link src 100.78.208.7 metric 700
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.18.0.0/16 dev br-f84515b28763 proto kernel scope link src 172.18.0.1
172.19.0.0/16 dev br-7a097267efa8 proto kernel scope link src 172.19.0.1
192.168.18.0/24 dev ethernet0 proto kernel scope link src 192.168.18.2 metric 100

The /etc/NetworkManager/system-connections/network0.nmconnection file looks like this:
[connection]
id=network0
uuid=958cc5e3-1bbf-3d64-beeb-020d4414e254
type=ethernet
interface-name=ethernet0
permissions=
timestamp=1644498971

[ethernet]
mac-address-blacklist=

[ipv4]
address1=192.168.18.2/24,192.168.18.1
dns=8.8.8.8;
dns-search=
method=manual

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

[proxy]

I can remove by using:
ip route del default via 192.168.18.1 dev ethernet0 proto static metric 100

Is there a simple way to make it persistent.

Best regards,
Adrian

Hi @adrmateu ,

we’re looking into it. We get back to you as soon as possible.

Best Regards
Kevin

Hi @adrmateu ,

Could you try to edit the NetworkManager configuration file located at /etc/sysconfig/network-scripts/ and change DEFROUTE=yes to DEFROUTE=no and see if this has the desired effect.

Let us know if it worked.

Best Regards
Kevin

I don’t have this directory on my system. I am using TorizonCore image
Linux verdin-imx8mm-06827554 5.4.129-5.4.0+git.cb88cc157bfb #1-TorizonCore SMP PREEMPT Wed Sep 29 18:17:21 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

Hi @adrmateu ,

Sorry for the delay.

There’s an article about networking with Torizon Core.

In there you can see a section that I think addresses what you’re trying to do.

The article mentions this command nmcli con delete '<Connection_name>' . I’m not sure if this setting is permanent or only temporary.

Can you give this a try and let me know if it worked?

Best Regards
Kevin