On Wed, Dec 22, 2021 at 01:58:22PM +0100, Felix Enrique Llorente Pastora wrote:
Hi,
I need to set the "description" field out of nmstate so I can mark some
interfaces that will be processed by nmstate later on. Do you know if it's
possible to do it with nmcli or busctl/dbus-send ?
Hi Quique,
With these command:
nmcli -f NAME,DBUS-PATH,FILENAME c show
You will get confutation file or dbus path of the setting.
You may chose any of this way:
* Parse configuration file and search for `nmstate.interface.description`
* Use dbus method GetSettings
* Submit feature request to NetworkManager asking for nmcli showing user
section.
Example output of qdbus command:
[fge@c8s eth]$ sudo qdbus --literal --system \
org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager/Settings/2 \
org.freedesktop.NetworkManager.Settings.Connection.GetSettings
[Argument: a{sa{sv}} {"connection" = [Argument: a{sv} {"id" =
[Variant(QString): "eth1"], "interface-name" = [Variant(QString):
"eth1"],
"lldp" = [Variant(int): 0], "permissions" = [Variant(QStringList):
{}],
"timestamp" = [Variant(qulonglong): 1640327553], "type" =
[Variant(QString):
"802-3-ethernet"], "uuid" = [Variant(QString):
"34a173a3-4783-4fbc-a082-b6add1247ffe"]}], "802-3-ethernet" =
[Argument: a{sv}
{"auto-negotiate" = [Variant(bool): false], "mac-address-blacklist" =
[Variant(QStringList): {}], "s390-options" = [Variant: [Argument: a{ss} {}]]}],
"ipv4" = [Argument: a{sv} {"address-data" = [Variant: [Argument:
aa{sv} {}]],
"addresses" = [Variant: [Argument: aau {}]], "dhcp-client-id" =
[Variant(QString): "mac"], "dns-search" = [Variant(QStringList): {}],
"method"
= [Variant(QString): "disabled"], "route-data" = [Variant: [Argument:
aa{sv}
{}]], "routes" = [Variant: [Argument: aau {}]]}], "ipv6" = [Argument:
a{sv}
{"addr-gen-mode" = [Variant(int): 0], "address-data" = [Variant:
[Argument:
aa{sv} {}]], "addresses" = [Variant: [Argument: a(ayuay) {}]],
"dhcp-duid" =
[Variant(QString): "ll"], "dhcp-iaid" = [Variant(QString):
"mac"], "dns-search"
= [Variant(QStringList): {}], "method" = [Variant(QString):
"link-local"],
"route-data" = [Variant: [Argument: aa{sv} {}]], "routes" = [Variant:
[Argument: a(ayuayu) {}]]}], "proxy" = [Argument: a{sv} {}], "user" =
[Argument: a{sv} {"data" = [Variant: [Argument: a{ss}
{"nmstate.interface.description" = "testing_nic"}]]}]}]
--
Gris Ge