This message was deleted.
# elemental
a
This message was deleted.
s
From Elemental PoV my first idea would be by adding a yip configuration by adding some udev rules in
initramfs
stage to actually rename the interface under some criteria. This could be done by simply dropping the udev rule file in the expected location. I am not familiar enough with Harvester is actually guide you properly on how to include additional config files within the host. The yip configuration could something in the spirit of:
Copy code
name: "Nic rename"
stages:
   initramfs:
     - name: "Nic rename"
       files:
       - path: /etc/udev/rules.d/70-persistent-custom-net.rules
         content: |
           SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="?*", NAME="lan0"
         permissions: 0600
This is just a trivial dump rule that renames any network interface to
lan0
b
Thanks! What we ended figuring out that the end of the day yesterday was adding some commands in that section right above the static DNS entries:
Copy code
- ip link set dev enp175s0f1 down
    - ip link set dev enp175s0f1 name lan100
    - ip link set dev lan100 up
Seems like that works? Does this seem sane?
b
the udev roules seems not to be applied because:
(udev-worker)[1608]: enp5s0f0: Network interface 'enp5s0f0' is already up, refusing to rename to 'ens1f0'.
b
ip link set dev enp5s0f0 down
I'd just use the ip link commands.
Alll that being said, Connor is probably right about how this is supposed to work and you shouldn't need it.
s
Yes I guess the issue on adding udev rules at boot time is if the initrd requires network or not. Should be safe adding udev rules in initrd phase if they are meant to be used in real root after switching root. If the link is up before that (usually due
rd.neednet=1
kernel param) I guess then you need to set the link down before any change as @bland-article-62755 suggests