<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>nfsroot= causes the interface to be brought up very early, before
      udev starts, and before it has a chance to apply its rules and
      .link files.</p>
    <p><br>
    </p>
    <p>Before kernel 6.2, it was not possible to rename interfaces that
      were already "up" (see linux commit bd039b5ea2a91).</p>
    <p><br>
    </p>
    <p>On another note, even though NamePolicy doesn't provide any names
      in your case, you should still clear it in general:</p>
    <p>[Link]</p>
    <p>NamePolicy=</p>
    <p>Name=mycustometh</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 17/06/2025 08.59, He, Guocai (CN)
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c7cf9d31-c350-49a2-af7e-fe5f1532dfd0@windriver.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <p class="elementToProof">Hi,</p>
      <p>I want to create a link file and want to match the mac to
        rename eth0 to mycustometh but fail.<br>
        seems that the link file is not applied?<br>
        The fllowing is my step and some logs:<br>
        <br>
        #1 etho mac<br>
        udevadm info /sys/class/net/eth0<br>
           E: ID_NET_NAME_MAC=enxa4bf016bfaf5<br>
         <br>
        #2 link file  <br>
        root@intel-x86-64:~# cat /etc/systemd/network/00-eth0.link<br>
        [Match]<br>
        MACAddress=a4:bf:01:6b:fa:f5<br>
        <br>
        [Link]<br>
        Name=mycustometh<br>
        <br>
        #3 only one link file<br>
        root@intel-x86-64:~# ls /etc/systemd/network/<br>
        00-eth0.link<br>
        <br>
        #4 the link file in /lib/systemd/network/  I try to remove
        99-default.link, it still not work<br>
        root@intel-x86-64:/lib/systemd/network# ls<br>
        80-6rd-tunnel.network       80-container-ve.network 
        80-wifi-adhoc.network            80-wired.network<br>
        80-container-host0.network  80-container-vz.network 
        80-wifi-ap.network.example       99-default.link<br>
        80-container-vb.network     80-vm-vt.network        
        80-wifi-station.network.example<br>
        root@intel-x86-64:/lib/systemd/network# cat 99-default.link<br>
        [Match]<br>
        OriginalName=*<br>
        <br>
        [Link]<br>
        NamePolicy=keep kernel database onboard slot path<br>
        AlternativeNamesPolicy=database onboard slot path<br>
        MACAddressPolicy=persistent<br>
        <br>
        #5 test the changes<br>
        root@intel-x86-64:~# udevadm test-builtin net_setup_link
        /sys/class/net/eth0<br>
        Trying to open "/etc/systemd/hwdb/hwdb.bin"...<br>
        Trying to open "/etc/udev/hwdb.bin"...<br>
        Trying to open "/usr/lib/systemd/hwdb/hwdb.bin"...<br>
        Trying to open "/lib/systemd/hwdb/hwdb.bin"...<br>
        Trying to open "/lib/udev/hwdb.bin"...<br>
        === trie on-disk ===<br>
        tool version:          250<br>
        file size:         9764936 bytes<br>
        header size             80 bytes<br>
        strings            2429280 bytes<br>
        nodes              7335576 bytes<br>
        Load module index<br>
        Found cgroup2 on /sys/fs/cgroup/unified, unified hierarchy for
        systemd controller<br>
        Found container virtualization none.<br>
        Loaded timestamp for '/etc/systemd/network'.<br>
        Parsed configuration file /etc/systemd/network/00-eth0.link<br>
        Created link configuration context.<br>
        eth0: Device has name_assign_type=1<br>
        eth0: Device has addr_assign_type=0<br>
        ID_NET_DRIVER=igb<br>
        eth0: Config file /etc/systemd/network/00-eth0.link is applied<br>
        eth0: Using static MAC address.<br>
        eth0: Policies didn't yield a name, using specified
        Name=mycustometh.<br>
        ID_NET_LINK_FILE=/etc/systemd/network/00-eth0.link<br>
        ID_NET_NAME=mycustometh<br>
        Unload module index<br>
        Unloaded link configuration context.<br>
        <br>
        #6 reboot and the eth0 is not changed<br>
        root@intel-x86-64:/# ip link<br>
        2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
        mq state UP mode DEFAULT group default qlen 1000<br>
            link/ether a4:bf:01:6b:fa:f5 brd ff:ff:ff:ff:ff:ff<br>
        <br>
        #7 boot cmdline<br>
        root@intel-x86-64:~# cat /proc/cmdline<br>
        kernel console=ttyS4,115200 root=/dev/sda1
        nfsroot=128.224.165.20:/export/pxeboot/vlm-boards/29170/rootfs,v3,tcp
        rw selinux=0 udev.log_priority=debug enforcing=0 intel_iommu=on
        iommu=pt no_console_suspend ignore_loglevel<br>
        <br>
        #8 logs after reboot, can not see such as "00-eth0.link is
        applied"<br>
        journalctl -u systemd-udevd<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Trying to open
        "/etc/udev/hwdb.bin"...<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Trying to open
        "/usr/lib/systemd/hwdb/hwdb.bin"...<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Trying to open
        "/lib/systemd/hwdb/hwdb.bin"...<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Trying to open
        "/lib/udev/hwdb.bin"...<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: === trie
        on-disk ===<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: tool
        version:          250<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: file
        size:         9764936 bytes<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: header
        size             80 bytes<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]:
        strings            2429280 bytes<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]:
        nodes              7335576 bytes<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Load module
        index<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Loaded
        timestamp for '/etc/systemd/network'.<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Parsed
        configuration file /etc/systemd/network/00-eth0.link<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Created link
        configuration context.<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Loaded
        timestamp for '/etc/udev/rules.d'.<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Loaded
        timestamp for '/lib/udev/rules.d'.<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Skipping
        overridden file '/lib/udev/rules.d/80-net-setup-link.rules'.<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Reading rules
        file: /lib/udev/rules.d/01-md-raid-creating.rules<br>
        Jun 17 02:46:02 intel-x86-64 systemd-udevd[252]: Reading rules
        file: /lib/udev/rules.d/10-dm.rules<br>
        ..................<br>
        <br>
        Anybody have meet the same issue? who can help to have a look at
        this issue?</p>
    </blockquote>
  </body>
</html>