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

nmstate does not disable interface when state:down and ipv4:false

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

    • nmstate-2.2.50-1.el10
    • No
    • Low
    • rhel-net-mgmt
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Hide

      Definition of Done:

      Please mark each item below with ( / ) if completed or ( x ) if incomplete:

      The acceptance criteria defined below are met.

      Given a system with an initrd-generated DHCP profile for an interface e.g. "ens15f1np1" and a nmstate YAML that sets "ens15f1np1" to state: down with ipv4.enabled: false, 

      When the configuration is applied via nmstatectl, 

      Then the interface "ens15f1np1" is immediately disconnected (no IP, no fallback profile) and after a reboot it is still disconnected or unmanaged, proving that no autoconnect profile was re-activated.


      Integration test case is available upstream.


      Code is reviewed and merged upstream.


      Preliminary testing is done.


      ( ) A demo is recorded

      Show
      Definition of Done: Please mark each item below with ( / ) if completed or ( x ) if incomplete: The acceptance criteria defined below are met. Given a system with an initrd-generated DHCP profile for an interface e.g. "ens15f1np1" and a nmstate YAML that sets "ens15f1np1" to state: down with ipv4.enabled: false,  When the configuration is applied via nmstatectl,  Then the interface "ens15f1np1" is immediately disconnected (no IP, no fallback profile) and after a reboot it is still disconnected or unmanaged, proving that no autoconnect profile was re-activated. Integration test case is available upstream. Code is reviewed and merged upstream. Preliminary testing is done. ( ) A demo is recorded
    • Pass
    • Automated
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      When applying the following nmstate manifest

                - name: ens15f1np1
                  type: ethernet
                  state: down
                  ipv4:
                    enabled: false
                    dhcp: false
      

      what we expect is that the interface ens15f1np1 will be DOWN with no IP address. But what happens in reality is that interface is UP with IP address assigned by DHCP server.


      Detailed slack discussion: https://redhat-internal.slack.com/archives/C04MH2B47HB/p1751462909670119


      Reproducer:

      1. Create the following file in /run/NetworkManager/system-connections/default_connection.nmconnection

      # Created by nm-initrd-generator
      [connection]
      id=Wired Connection
      uuid=0c549a54-83e6-46b9-8d80-245bd752abfb
      type=ethernet
      autoconnect-priority=-100
      autoconnect-retries=1
      multi-connect=3
      [ethernet]
      [ipv4]
      dhcp-timeout=90
      may-fail=false
      method=auto
      [ipv6]
      dhcp-timeout=90
      method=auto
      [proxy]
      [user]
      org.freedesktop.NetworkManager.origin=nm-initrd-generator
      

      2. Do `nmcli c down eth0` (or with `nmcli apply` with state: down , same result)
      3. See that "Wired connection" is activated on the device

              rh-ee-mshi1 Mingyu Shi
              mkowalsk@redhat.com Mat Kowalski
              Network Management Team Network Management Team
              Mingyu Shi Mingyu Shi
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated: