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

DHCPv4 lease can't be renewed after it expires

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • NetworkManager-1.46.0-1.el9
    • Yes
    • None
    • 1
    • rhel-net-mgmt
    • ssg_networking
    • 26
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • NMT - Last NMT changes
    • Hide

      Given a system administrator suspends a Fedora VM overnight, using NetworkManager version 1.46-rc1, which results in the DHCPv4 lease expiring during suspension,
      When the VM is resumed and attempts to renew its DHCPv4 lease,
      Then NetworkManager should successfully renew the lease without sending a DHCP DECLINE due to a mistaken assumption of a duplicate address.

      Definition of Done:

      • The implementation meets the acceptance criteria
      • Unit test and integration test are written and pass
      Show
      Given a system administrator suspends a Fedora VM overnight, using NetworkManager version 1.46-rc1, which results in the DHCPv4 lease expiring during suspension, When the VM is resumed and attempts to renew its DHCPv4 lease, Then NetworkManager should successfully renew the lease without sending a DHCP DECLINE due to a mistaken assumption of a duplicate address. Definition of Done: The implementation meets the acceptance criteria Unit test and integration test are written and pass
    • Pass
    • Automated
    • None

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

      Every time I suspend my laptop and resume it the next day, my Fedora VM loses the DHCPv4 address and is not able to renew it. After we enabled IPv4 DAD by default, NM tries to get a new lease and then sends a DHCP DECLINE because it thinks the address is duplicate.

      Please provide the package NVR for which bug is seen:

      1.46-rc1

      How reproducible:

      Always

      Steps to reproduce

      Suspend the machine; any VM using NM 1.46-rc1 will lose the address if the suspend time is greater than the lease time. Or use the following script:

      #!/bin/sh
      
      set -e
      
      cleanup()
      {
          (
              ip netns del ns1
              ip link delete veth0
              ip link delete veth1
              nmcli connection delete veth0+
              killall dnsmasq
          ) 2>/dev/null || true
      }
      
      check_address()
      {
          if [ $(ip -j addr show veth0 | jq -r .[0].addr_info[0].local | wc -l) != 1 ]; then
              echo "Error: address not configured"
              ip addr show veth0
              exit 1
          fi
      }
      
      cleanup
      
      echo "* setup..."
      
      ip netns add ns1
      ip link add veth0 type veth peer netns ns1 name veth1
      ip link set veth0 up
      ip -n ns1 link set veth1 up
      ip -n ns1 addr add dev veth1 172.25.10.1/24
      
      ip netns exec ns1 dnsmasq --bind-interfaces --interface veth1 -d --dhcp-range=172.25.10.100,172.25.10.200,60 &
      
      echo "* activate connection..."
      
      nmcli connection add type ethernet ifname veth0 con-name veth0+ ipv6.method disabled connection.autoconnect no
      nmcli connection up veth0+
      
      check_address
      
      echo "* wait expiry..."
      
      killall dnsmasq
      
      for i in $(seq 1 122); do
          sleep 1
          echo "   - after $i seconds: $(ip -j addr show veth0 | jq -r '.[0].addr_info[0].local,.[0].addr_info[0].valid_life_time' | tr '\n' ' ')"
      done
      
      echo "* restart DHCP server..."
      ip netns exec ns1 dnsmasq --bind-interfaces --interface veth1 -d --dhcp-range=172.25.10.100,172.25.10.200,60 &
      
      for i in $(seq 1 20); do
          sleep 1
          echo "   - after $i seconds: $(ip -j addr show veth0 | jq -r '.[0].addr_info[0].local,.[0].addr_info[0].valid_life_time' | tr '\n' ' ')"
      done
      
      

      Expected results

      The lease is renewed immediately.

      Actual results

      NM sends a DHCP DECLINE.

              bgalvani@redhat.com Beniamino Galvani
              bgalvani@redhat.com Beniamino Galvani
              Beniamino Galvani Beniamino Galvani
              Matej Berezny Matej Berezny (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: