Eduardo G's picture

Hi, im using Turnkeycore 16.1, which is based in Debian Buster 10.

The network interface name, e.g. eth0, is assigned to each hardware in the Linux kernel through the user space configuration mechanism, udev (see Section 3.3, “The udev system”), as it is found. The network interface name is referred as physical interface in ifup(8) and interfaces(5).

 

But since Debian Buster the preferred way is:

https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInte...

  1. Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
  2. Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
  3. Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
  4. Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
  5. Classic, unpredictable kernel-native ethX naming (example: eth0)

So instead eth0, eth1... the names could be enp2s0, enp2s1 ... etc..So i have beent tweaking and googling and i cant get the "new" names, i got eth0 and eth1 to the two network interfaces added using vbox ( eth0 in mode bridge, and eth1 in mode internal network)

 

How can i setup turnkey to appear the new names instead old, deprecated names ?

 

Thanks

Forum: 
Jeremy Davis's picture

As you note we use the legacy interface names. We do that intentionally as NICs tend to be static in servers, so we figured that made the most sense.

Having said that, if you prefer to use the "predictable names", then changing it to use that shouldn't cause any issues.

If you look in the grub config file (/etc/default/grub) then you'll find this line:

GRUB_CMDLINE_LINUX="net.ifnames=0"

Simply remove the 'net.ifnames=0' so it looks like this:

GRUB_CMDLINE_LINUX=""

Then update grub and reboot:

upgrade-grub
reboot

And you should now have "predictable names". If that's your only interface, then Confconsole should auto update to report on the new interface. If not, you may need to explicitly tell it which interface to show (set 'default_nic' value in /etc/confconsole/confconsole.conf).

Eduardo G's picture

I did what you said, changing to:

GRUB_CMDLINE_LINUX=""

reboot machine, and still with old names.....

I have two virtualbox adapters, one in mode bridge and the other for internal network.

I  didnt understand : If not, you may need to explicitly tell it which interface to show (set 'default_nic' value in /etc/confconsole/confconsole.conf).

Thanks

Jeremy Davis's picture

You need to run the 'update-grub' command too for the settings to be applied to the actual boot time grub config.

Re my comment about Confconsole, that was referring to the interface that Confconsole displays by default. It should probably "just work", although if it doesn't, you'll need to adjust the Confconsole config file (/etc/confconsole/confconsole.conf). Uncomment the line (i.e. remove the leading '#') and change the default 'eth0' to the name of your interface.

Hopefully that's a bit clearer?

Eduardo G's picture

Id try de confconsole later, but i suppose that when i reboot, or even when i shutdown the machine and boot again, the update-grub is made automatically no ? or i have to extecute it ? I have shutdown several times and and rebooted several times, and still the old names....

 

Jeremy Davis's picture

No you need to run 'update-grub' manually!

The grub config that is used at boot time (/boot/grub/grub.cfg) is incredibly complex. So instead of manually editing that and running the risk of making your server unbootable, the actual grub config used at boot time is generated by the 'update-grub' script. To make changes, the very simple /etc/default/grub config file is edited, then the 'update-grub' command run to generate the "real" grub.cfg.

Philipp's picture

I have just tried to change the interface names to "new" format. Editing the /etc/default/grub.conf works fine and now my interfaces are visible. But now I am not able to configure the interfaces via confconsole. 

What do I have to change, in order to make confsonsole working again?

Regards

Jeremy Davis's picture

Change the 'default_nic' in the config file (/etc/confconsole/confconsole.conf). It probably also needs to be uncommented - i.e. remove the preceeding hash ('#'). For example, if your new NIC name is 'enp41s0', you need to change this:

# default network interface to display in usage
#default_nic eth0

To this:

# default network interface to display in usage
default_nic enp41s0
Philipp's picture

Changing the value in confconsole.conf can only be done, when knowing Interface. My Problem is with old naming convention on each reboot the nics have Changes, e.g. first boot eth0, second eth1, third eth0 again, etc...

And with new convention, the nics cannot be configured. Probably because per default the Interfaces eth0 and eth1 are predefined in /etc/Network/Interfaces. 

Deploying my appliance in a Intel Hardware server with Supermicro Board (100% Debian 10 compatible)

Any Idea how that can be resolved?

Jeremy Davis's picture

Firstly, the obligatory recommendation. Personally I wouldn't install TurnKey to bare metal. IMO it's better to install a hypervisor host OS and then install Turnkey as a guest. Even if you only plan to run a single server, having it running as a guest on a hypervisor makes management and maintenance far better IMO.

I use (and highly recommend) Proxmox VE. It's a FOSS Debian based hypervisor OS, which supports both KVM (for full virtualisation; can support any OS) and LXC (OS container platform; only supports Linux). TurnKey LXC builds are available for download within the web based admin UI.

With that out of the way and assuming that you wish to proceed with a bare metal TurnKey instance, I'll answer your specific question.


The first thought that comes to mind is that you must have had access to a local terminal to install it in the first place, right? So why not just access it via that rather than via the network? I.e. use a local terminal (plugin screen & keyboard), rather than SSH/Webshell - which obviously requires you to know the IP.

Having said that, there should be an easier way. As it's actually systemd that implements the "predictable interface names" (the kernel still initialises the interfaces as 'eth0' etc, then systemd renames them) then as per the name, it should be possible to actually predict what the interface name will be! You just need to parse the same info that systemd will at boot time to determine what the "predictable interface name" will be.

A bit of googling turned up the systemd.net-naming-scheme man page. That essentially explains how it determines the "predictable interface names". For the uninitiated, reading about "Predictable NetworkInterface Names" might be useful background reading.

Some further mucking around lead me to this command:

udevadm info --export --query=property --path=/sys/class/net/eth0

On a local TurnKey v17.0rc1 (KVM) VM; that returns this:

DEVPATH='/devices/pci0000:00/0000:00:12.0/virtio2/net/eth0'
INTERFACE='eth0'
IFINDEX='2'
SUBSYSTEM='net'
USEC_INITIALIZED='2643182'
ID_NET_NAMING_SCHEME='v247'
ID_NET_NAME_MAC='enxb6d6b3f258c4'
ID_NET_NAME_PATH='enp0s18'
ID_NET_NAME_SLOT='ens18'
ID_BUS='pci'
ID_VENDOR_ID='0x1af4'
ID_MODEL_ID='0x1000'
ID_PCI_CLASS_FROM_DATABASE='Network controller'
ID_PCI_SUBCLASS_FROM_DATABASE='Ethernet controller'
ID_VENDOR_FROM_DATABASE='Red Hat, Inc.'
ID_MODEL_FROM_DATABASE='Virtio network device'
ID_PATH='pci-0000:00:12.0'
ID_PATH_TAG='pci-0000_00_12_0'
ID_NET_DRIVER='virtio_net'
ID_NET_LINK_FILE='/usr/lib/systemd/network/99-default.link'
ID_NET_NAME='eth0'
SYSTEMD_ALIAS='/sys/subsystem/net/devices/eth0'
TAGS=':systemd:'
CURRENT_TAGS=':systemd:'

From what I can gather, the value of ID_NET_NAME_PATH should be the "predictable interface name". FWIW, you can run it through sed to get just the interface name:

udevadm info --export --query=property --path=/sys/class/net/eth0 | sed -n "\|ID_NET_NAME_PATH| s|^.*='\([a-z0-9]*\).*|\1|p"

Which for me, outputs:

enp0s18

As you note, you'll then need to also update the /etc/network/interfaces file. You should just be able to change the interface name (i.e. swap 'eth0' for whatever the above gives you). Note that the interface name may (will?) appear more than once in the interfaces file.

Hopefully that works for you. Whilst I'm fairly confident that it should, I haven't tested so I can't be sure. Please share whether it works or not.

Add new comment