Bug 1763054

Summary: connection.interface-name problem with type dummy
Product: Red Hat Enterprise Linux 8 Reporter: Filip Pokryvka <fpokryvk>
Component: NetworkManagerAssignee: Thomas Haller <thaller>
Status: CLOSED ERRATA QA Contact: Matej Berezny <mberezny>
Severity: medium Docs Contact:
Priority: medium    
Version: ---CC: bgalvani, fge, fgiudici, lrintel, rkhan, sukulkar, thaller, till, vbenes
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: NetworkManager-1.34.0-0.1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 14:54:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Filip Pokryvka 2019-10-18 07:33:01 UTC
Description of problem:
dummy connections/devices behave differently than other connections/devices

Version-Release number of selected component (if applicable):
1.20.0-3.el8

How reproducible:
always

Steps to Reproduce:
1. nmcli con add type dummy con-name dummy0 ifname '*'
2. nmcli con up id dummy0 ifname dummy1
3. nmcli dev connect dummy1

Actual results:
1. Error: Failed to add 'dummy0' connection: connection.interface-name: property is missing

2.1 if dummy0 is of type dummy, it activates on device saved in connection dummy0, not device dummy1
2.2 if dummy0 is of type generic: Error: device 'dummy1' not compatible with connection 'dummy0': The connection was not a dummy connection..

3. Error: Failed to add/activate new connection: A 'dummy' setting is required.


Expected results:
cases above should work without error

Additional info:
in step 1.) if connection.interface-name '*' is used, then NM add connection, but creates new device named '*'

Comment 1 Beniamino Galvani 2020-04-23 07:15:44 UTC
> Steps to Reproduce:
> 1. nmcli con add type dummy con-name dummy0 ifname '*'
> 2. nmcli con up id dummy0 ifname dummy1
> 3. nmcli dev connect dummy1
>
> Actual results:
> 1. Error: Failed to add 'dummy0' connection: connection.interface-name: property is missing

I think this is expected. A interface name is required for virtual
devices. For some virtual devices like bridges, bonds, teams if
the user doesn't provide an interface name, nmcli generates it:

 # nmcli connection add type bridge con-name bridge+
 Connection 'bridge+' (7f269797-d9f8-42de-9af1-e4a2e18fc62e) successfully added.
 # nmcli -g connection.interface-name connection show bridge+
 nm-bridge

But this behavior doesn't work for all devices and also doesn't seem
particularly useful, because once the user has generated this bridge
with an unknown name, it must discover what name was generated to set
it in slave connections.

> 2.1 if dummy0 is of type dummy, it activates on device saved in connection dummy0, not device dummy1
> 2.2 if dummy0 is of type generic: Error: device 'dummy1' not compatible with connection 'dummy0': The connection was not a dummy connection..
>
> 3. Error: Failed to add/activate new connection: A 'dummy' setting is required.

Steps 2 and 3 assume that the interface-name of a dummy can be unset,
which is not the case (at least, currently).

> Expected results:
> cases above should work without error
>
> Additional info:
> in step 1.) if connection.interface-name '*' is used, then NM add connection, but creates new device named '*'

Yeah, for historical reasons "ifname '*'" means an empty interface
name. If you use the full property name, no conversion is done and the
actual value is used; a interface name of '*' is legitimate.

Comment 3 Filip Pokryvka 2020-10-23 10:30:30 UTC
(In reply to Beniamino Galvani from comment #1)
> >
> > 3. Error: Failed to add/activate new connection: A 'dummy' setting is required.
> 
> Steps 2 and 3 assume that the interface-name of a dummy can be unset,
> which is not the case (at least, currently).

I agree with your comments, that steps 1 and 2 are not supposed to work on virtual devices.

However, step 3 (nmcli dev connect dummy1) does not assume interface-name to be unset. It does not work, even if there is a dummy connection that has interface-name set to dummy1 and is currently down. The problem might be, that NM for dummy connection always creates its dummy interface itself, and can not therefore work with dummy interface created outside NM. If this is a case, please feel free to close this, as it is not a bug.

Comment 4 Beniamino Galvani 2021-03-02 08:43:56 UTC
(In reply to Filip Pokryvka from comment #3)
> However, step 3 (nmcli dev connect dummy1) does not assume interface-name to
> be unset. It does not work, even if there is a dummy connection that has
> interface-name set to dummy1 and is currently down. The problem might be,
> that NM for dummy connection always creates its dummy interface itself, and
> can not therefore work with dummy interface created outside NM. If this is a
> case, please feel free to close this, as it is not a bug.

For some virtual interfaces (for example, veths) "nmcli device connect" creates a new connection and activates it. It would be easy to make it work also for dummy interfaces. I will prepare a patch.

Comment 7 Thomas Haller 2021-07-08 15:26:55 UTC
merged to `main` with [1].

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/e16c50f507703f15a550b4ef80448dcbd3a85131


this is no material to backport to nm-1-32, rhel-8.5 or rhel-9.0-beta.

Instead, it will be in 1.34.0+, rhel-8.6+ and rhel-9.0-GA.

Comment 14 errata-xmlrpc 2022-05-10 14:54:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (NetworkManager bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:1985