Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-17310

NetworkManager - support DHCPRELEASE (DHCPv4 and DHCPv6)

    • NetworkManager-1.47.2-1.el9
    • FutureFeature
    • 1
    • sst_network_management
    • ssg_networking
    • 3
    • False
    • Hide

      None

      Show
      None
    • No
    • Red Hat Enterprise Linux
    • NMT - RHEL-9.5 DTM 2
    • Hide

      As a system administrator, I need NetworkManager to send a DHCPv6 RELEASE message when stopping the network service, especially during system shutdowns, to ensure that DHCPv6 addresses are properly released and can be reassigned to the same or different clients as needed.

      Acceptance Criteria:

      Given a system administrator using NetworkManager,
      When they configure a network connection with ipv6.dhcp-send-release=yes in NetworkManager.conf or for specific connections,
      Then NetworkManager should send a DHCPv6 RELEASE message when a network connection is brought down or networking is turned off manually.

      Given the DHCPv6 RELEASE feature is enabled in NetworkManager,
      When a system configured with static DHCPv6 reservations has a network connection brought down or a networking turned off manually
      Then the DHCPv6 address should be released, allowing the DHCP server to reassign the same address to the same client or a different client if needed

      Given a system administrator using NetworkManager,
      When they enable the connection.down_on_shutdown=yes in NetworkManager.conf or for specific connections to allow for the removal of IP addresses upon system shutdown,
      Then NetworkManager should remove all configured IP addresses on system shutdown, and send a DHCPv6 RELEASE message for each IPv6 address.

      Definition of Done:

      • The implementation meets the acceptance criteria
      • Unit test and integration test are written and pass
      • The code is part of a build attached to an errata
      Show
      As a system administrator, I need NetworkManager to send a DHCPv6 RELEASE message when stopping the network service, especially during system shutdowns, to ensure that DHCPv6 addresses are properly released and can be reassigned to the same or different clients as needed. Acceptance Criteria: Given a system administrator using NetworkManager, When they configure a network connection with ipv6.dhcp-send-release=yes in NetworkManager.conf or for specific connections, Then NetworkManager should send a DHCPv6 RELEASE message when a network connection is brought down or networking is turned off manually. Given the DHCPv6 RELEASE feature is enabled in NetworkManager, When a system configured with static DHCPv6 reservations has a network connection brought down or a networking turned off manually Then the DHCPv6 address should be released, allowing the DHCP server to reassign the same address to the same client or a different client if needed Given a system administrator using NetworkManager, When they enable the connection.down_on_shutdown=yes in NetworkManager.conf or for specific connections to allow for the removal of IP addresses upon system shutdown, Then NetworkManager should remove all configured IP addresses on system shutdown, and send a DHCPv6 RELEASE message for each IPv6 address. Definition of Done: The implementation meets the acceptance criteria Unit test and integration test are written and pass The code is part of a build attached to an errata
    • Pass
    • None
    • None

      What were you trying to do that didn't work?

      Need NetworkManager to do a DHCPv6 RELEASE when stopping the network service - on shutdown.

      Why?

      Because we are using a DHCPv6 server without at pool of addresses, all hosts are configured mapping the MAC address to an address.

      We are using this DHCP configuration when installing RHCOS utilizing a Live image booted from ISO to for bootstrap the node. Since NetworkManager in the Live Image does not do a RELEASE - the installed system is unable to get a lease from the DHCPv6 server because the address assigned is already leased to a different client.

      I believe the same issue would materialize when using RHEL Kickstart installation.

      DHCPv6 uses the DUID to map client-to-lease, the DUID in NetworkManager is by default DUID-UUID based on `/etc/machine-id` - since the DUID-UUID won't be the same for the Live ISO bootstrap image and the image booting from disk after bootstrap the DHCP reservation must be released by the Live ISO.

      The default DHCPv6 lease time is 24 hours, so it will take ~24 hours before the OS installed to disk get it's ip configuration. Any post boot operations triggered from inside installed OS that require network access, or attempts to manage the host with automation (ansible) will fail - unless such automation is extremely tolerable to long time delays.

      Other usecases for DHCPRELEASE:

      1. Users are spinning up and down ephemeral VMs very fast and would like to have a way to cleanly release the IP when they are done.
      2. DHCP server is configuring DNS via DDNS - users want to be able to clean up/remove DNS records when an address is released.
      3. There is an upstream issue with more usecases - https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/742 (But it keeps being auto-closed because of inactivity)

      NOTE:

      This behaviour should be optional, i.e enabled by configuration. In the live ISO bootstrap we want it enabled, but enabling it on the OS installed on disk might not be desired. So we need an option for connections for example ``ipvX.dhcp-send-release=yes`` and something in NetworkManager.conf to enable|disable it as default for all connections. For example, adding something like this in NetworkManager.conf would enable DHCPRELEASE for both IPv4 and IPv6 as default for all connections.

      [connection]
      ipv4.dhcp-send-release=yes
      ipv6.dhcp-send-release=yes
      
      

      Please provide the package NVR for which bug is seen:

      NetworkManager-1.44.0-3.el9.x86_64.rpm

      How reproducible:

      100 %

      Steps to reproduce

      1. Configure DHCPv6 using dnsmasq with static reservations only. No pool/range.
        Example dnsmasq.conf:

      dhcp-range=fd00:abcd:abcd:fc00::,static,64
      dhcp-host=52:54:00:8C:1E:63,[fd00:abcd:abcd:fc00::11]
      log-dhcp

      1. Boot a Live image, and write the OS image to disk.
      2. Reboot into the OS booting from disk.

      Expected results

      The Live image boots and gets ``fd00:abcd:abcd:fc00::11`` leased. Writes the image, and then, the OS booting from disk should get the same address ``fd00:abcd:abcd:fc00::11``.

      Actual results

      After rebooting to disk, the node is unable to retrieve it's address. The DHCP server (dnsmasq) respond "no address available":

      Nov 22 20:30:37 fedora dnsmasq-dhcp[26419]: 8813127 DHCPREPLY(nat64) 00:03:00:01:52:54:00:8c:1e:63 no addresses available

       

              ferferna Fernando Fernandez Mancera
              rhn-gps-hjensas Harald Jensas
              Fernando Fernandez Mancera Fernando Fernandez Mancera
              Vladimir Benes Vladimir Benes
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: