Score:2

nmcli eqivalent of ip route add command for interface routing

rw flag

I can add route over the interface using ip route add command, for example:

ip r a 1.1.244.244/32 dev main-br

How to achieve the same using nmcli?

Score:2
pt flag

A search for nmcli add route brings us to this documentation, which says that we can add a static route like this:

nmcli connection modify enp1s0 +ipv4.routes "192.168.122.0/24 10.10.10.1"

Experimenting with that command, it looks like if you want to specify a device route as in your example, you can simply leave out the nexthop address, giving you:

nmcli connection modify enp1s0 +ipv4.routes "192.168.122.0/24"

Or in your case:

nmcli connection modify <connection_name> +ipv4.routes 1.1.244.244/32

Where you would replace <connection_name> with the name of the networkmanager connection associated with device main-br.

cn flag
I have the same requirement as OP. That is, this works: ip route add 192.168.39.11/32 dev br0 the nmcli connection name is also br0. `nmcli connection modify br0 +ipv4.routes 192.168.39.11/32` but the bridge breaks now. The VM can not connect. the br0.nmconnection now has this: `[ipv4] method=auto route1=192.168.39.11/32 `
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.