Seems like $real is empty during setup. But now if I run
ip -o link | awk '/86:ce:ea:52:51:42/ {print $2;}' | sed s/://
on this very host, I am getting ens18 as result. This is not the interface-name I set up during creation (net0) and I am wondering if this could be an issue with the Proxmox-plugin, which forces me to set the interface name to net[n] or a more generic error.
Okay, this is also a trap: The interface’s name has to be net[n], because if it’s not, I can not modify that host, as the proxmox-plugin keeps complaining:
Must be net[n] with n integer >= 0
So I am wondering why the interface-name is ens18 in the installer and not net0 as I set in the interface-configuration.
Well, I am from Red Hat and I am not particularly good in writing preseed files as well.
Have you seen Czech layout yet?
This is a question for Proxmox, Debian engineers or Linux kernel drivers. Anaconda in Red Hat uses Dracut which uses systemd (by default) which applies the predictable naming scheme. If there is some mechanism in Proxmox Linux drivers there must be something wrong.
Can you try to avoid awk. Use sed or something what is available.
That’s too bad. But maybe there’s somebody out here who did solve this using preseed…?
Haha, no No party to type on a VNC console with EN_US-Layout, too, hm?
Hm, I opened an issue on the plugin’s GitHub repo. Seems like the net naming-schema comes from fog_proxmox. But on VMs I created manually the interfaces are named ens18, too - even if Proxmox calls the ethernet-card itself net0 in the hardware-overview. So it seems to be some kind of convention in fog_proxmox.
Thank you for your help and maybe there’s someone out there who faced the same problems.
But from what I understand, isn’t the problem more in fact that awk is missing for some reason rather than from interface name? Because that is exactly for the shell line you refer to is - to actually ignore interfafe name and find the real identifier via MAC addres.
Alright, seems like I was able to solve the first problem:
Replacing
real=`ip -o link | awk '/<%= @host.mac -%>/ {print $2;}' | sed s/://`
with
real=`ip -o link | grep -i '<%= @host.mac -%>' | cut -d' ' -f2 | sed s/://`
returns the correct interface name now and /etc/network/interfaces looks fine now. The problem regarding the interface-name remains, but I’ll open a new topic for that.
Thanks for getting back to us, would you mind opening a PR against:
To be on the safest side, you can write something like "if awk is available, then do awk, otherwise do grep/cut. I am not really sure why is that you don’t have awk. So let’s not break this for others but fix the problem.