Score:1

Difference between network bridges created by `ip` and `nmcli`

us flag

I notice that the bridges created by ip command and nmcli command are distinct:

# Create a bridge via ip command and name it br-ip
ip link add dev br-ip type bridge 

# Create another bridge via nmcli command and name it br-nmcli
nmcli con add ifname br-nmcli type bridge con-name br-nmcli 

The two bridges look like:

21: br-ip: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b6:9a:7a:57:63:7f brd ff:ff:ff:ff:ff:ff
22: br-nmcli: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether d2:fc:b8:6f:e3:2e brd ff:ff:ff:ff:ff:ff

The br-nmcli has NO-CARRIER tagged and has noqueue qdisc.

However, the br-ip has no NO-CARRIER tag and uses noop as its default qdisc.

So, how could I create a bridge via nmcli has the same result as ip command?

Besides, what does NO_CARRIER mean?

in flag
`NO_CARRIER` means that the interface has no link/cable connected (which should propagate from underlaying interfaces) What about `ip link set br-ip up`?
A.B avatar
cl flag
A.B
Carrier detection works only when the interface is up. If you set a MAC address on a bridge it goes directly to NO-CARRIER state until there's a bridge port added with a carrier. I you don't set a MAC address on a bridge, it's given the benefit of the doubt with an UNKNOWN state that is accepted as if it were connected. Once the first bridge port is added, behavior wrt carrier will be the same (behavior wrt the MAC address won't). Guess what? nmcli set an address. You can do the same: `ip link add name br-ip address 12:34:56:78:9a:bc up type bridge`.
Score:0
cn flag

nmcli does a few things under the hood, it won't be totally equivalent to a single ip command. Unless you are specifically interested in those parameters, I would't be concerned.

Unless something isn't working of course!

As to producing the same output, I'd expect there to be some way of adding options to nmcli to set the flags required.

EDIT: haven't quickly found a full list of options, but some additional info is on the RedHat pages: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmcli

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.