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