0

Using an alias in nmcli connection modify seems to append the value regardless of the prefix used. For example, nmcli connection modify wifi -ip4 192.168.1.10/24 does not remove the IP but add it. Using the complete settings.property format with prefix presents no issues. From man nmcli:

 modify [--temporary] [id | uuid | path] [ID] {option value | [+|-]setting.property value}... Add, modify or remove properties in the connection profile. To set the property just specify the property name followed by the value. An empty value ("") resets the property value to the default. See nm-settings-nmcli(5) for complete reference of setting and property names, their descriptions and default values. The setting and property can be abbreviated provided they are unique. If you want to append an item or a flag to the existing value, use + prefix for the property name or alias. If you want to remove items from a container-type or flag property, use - prefix. For certain properties you can also remove elements by specifying the zero-based index(es). The + and - modifiers only have a real effect for properties that support them. These are for example multi-value (container) properties or flags like ipv4.dns, ip4, ipv4.addresses, bond.options, 802-1x.phase1-auth-flags etc. 

Is this intended? If so, why?

    1 Answer 1

    0

    Looks like a bug (which should be reported at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues and fixed).

    ip4 is an alias for ipv4.addresses. It works with -ipv4.addresses.

      You must log in to answer this question.

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.