Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2150888

Summary: MACsec tunnel is deactivated when the remote host is not reachable, and never retries
Product: Red Hat Enterprise Linux 9 Reporter: Beniamino Galvani <bgalvani>
Component: NetworkManagerAssignee: Íñigo Huguet <ihuguet>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 9.2CC: bgalvani, ferferna, lrintel, rkhan, sfaye, sukulkar, till
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-20 10:01:31 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:
Attachments:
Description Flags
Reproducer none

Description Beniamino Galvani 2022-12-05 14:30:52 UTC
This bug was initially created as a copy of Bug #2122564.

When the remote host becomes temporary unreachable, the MACsec connection goes down and is never retried, even when the remote host is reachable again.

NM version: 1.40.0 and earlier

Comment 1 Beniamino Galvani 2022-12-05 16:06:46 UTC
I think the issue is related to the carrier state of the macsec interface. With the reproducer in attachment I see that when NetworkManager-config-server is not installed, the macsec connection deactivates and stay down once the remote peer is unreachable.

With NetworkManager-config-server installed, the macsec connection always stays up because NM ignores the carrier of the interface.

So, a workaround to the issue is to either install NetworkManager-config-server or to create the following configuration snippet:

 # cat /etc/NetworkManager/conf.d/10-macsec-ignore-carrier.conf
 [device-macsec]
 match-device=type:macsec
 ignore-carrier=yes

In any case, there should be a mechanism to retry the activation after the macsec interface gets carrier when NM-config-server is not installed.

Comment 2 Beniamino Galvani 2022-12-05 16:07:29 UTC
Created attachment 1930137 [details]
Reproducer

Comment 4 Íñigo Huguet 2023-07-19 12:59:17 UTC
I have used the reproducer and I think that Beniamino is correct. This is what happens when the link comes down with different combinations of ignore-carrier and autoconnect:
- ignore-carrier=no, autoconnect=no: macsec connection goes down and stays down
- ignore-carrier=no, autoconnect=yes: macsec connection goes down but reconnects with some delay after the link is up again
- ignore-carrier=yes: macsec connection doesn't go down and connectivity is OK after the link is up again

In all the cases it seems to be doing the correct behaviour, the same than other connection types with each configuration.

A potential improvement would be to set ignore-carrier=yes by default for macsec devices, as it is done for bond, bridge, etc.

I don't see any reason to implement a reconnection timer, treating macsec in a special way. All devices configured with ignore-carrier=no and autoconnect=no suffer the same problem. So another potential improvement, not only for macsec but for any connection type, would be to implement an "autoreconnect" feature:
1. The connection has autoconnect=no because the user don't want it to be enabled automatically
2. The user manually enable the connection
3. Links comes down so the connection is bring down
4. Now, connectivity is lost until it is manually restored. With the new autoreconnect=yes, connectivity would be automatically restored when the link is up again.

Comment 5 Íñigo Huguet 2023-07-20 10:01:31 UTC
As explained in comment 4, and after discussing it with the rest of the team, we think that the behaviour is correct. To have the desired behaviours of Macsec's connectivity being restored, the user needs to set either ignore-carrier=yes or autoconnect=yes. This is coherent with the behaviour of other similar device/connection types.

Closing as NOTABUG.

For the "autoreconnect" idea, I have filled a feature request upstream: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1353