Here are descriptions of some workarounds we developed to allow old versions of Bruker Topspin™ to run on CentOS 7.
Network Interface Names
The old traditional interface names are hard coded into old versions of of Topspin. The software expects that an interface named “eth0” will be the external (i.e. public) network interface and eth1 will be the internal interface, connecting to the NMR console hardware. The Bruker/Flexlm license manager uses the MAC address of eth0 for license validation.
Under modern linux with systemd startup manager, startup is multithreaded. The order of startup of network interfaces is therefore unpredictable, and therefore the order of assignment of the traditional kernel network interface names is also unpredictable and non-reproducible between boots. Normally this is not a problem, due to Consistent Network Device Naming by which these devices get renamed to modern style names derived from physical bus and slot numbers of the NIC. However, because the network names “eth0” and “eth1” are hard coded into Topspin, we need to rename the NIC interfaces accordingly. There are a few ways to disabling Consistent Network Device Naming. This results in old-style network interface names. However, the names “eth0” and “eth1” might be assigned to the internal or external interface in either order, varying from one boot to another.
Identifying the interfaces by their MAC addresses, I attempted to rename them by all of the various means available: kernel boot parameters, udev configuration, network config scripts and boot scripts, and I could rename the interfaces to anything else except for the names we needed. The problem was that these kernel names. eth0 and eth1, are in use already, as these names get bound to the interfaces early in the boot process. So first the interfaces must be renamed to anything other than the default kernel names, so as to free these ethn names to make them available for assignment.
There are several ways to accomplish this. I describe only the method I finally chose to use. I want to set the alternate network names early in the boot process, so I configure it in the initrd (initial ramdisk) image.
I create a dracut configuration file, assigning the alternate interface names to my network interfaces, identified by their the MAC hardware addresses. Then I rebuild the initrd image.
bash-4.2# cat /etc/dracut.conf.d/netnames.conf ifname=net0:68:05:ca:0a:0b:0c ifname=net1:78:45:c4:11:22:33 biosdevname=0 bash-4.2#mkinitrd --force /boot/initramfs-3.10.0-693.21.1.el7.x86_64.img 3.10.0-693.21.1.el7.x86_64
I name them net0 and net1, but any arbitrary names will do, since these names are temporary, serving only to unbind the names we will ultimately need to assign.
Also I insert this line into /etc/default/grub
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
and remake grub.cfg with /usr/sbin/grub2-mkconfig.
I will do the final renaming in the interface config files (/etc/sysconfig/network-scripts). First I will disable NetworkManager because it tends to mess with these files. I don’t want NM to overwrite my customizations:
bash-4.2# systemctl stop NetworkManager bash-4.2# systemctl disable NetworkManager bash-4.2# yum remove NetworkManager
I will replace NM with the old-style “network” initscript
bash-4.2# yum install initscripts bash-4.2# systemctl enable network bash-4.2# systemctl start network
Topspin requires that we rename the external interface, temporarily named net0, to eth0. I create /etc/sysconfig/network-scripts/ifcfg-etch0 with the following lines
bash-4.2# cat ifcfg-eth0 BOOTPROTO=none ONBOOT=yes DEFROUTE="yes" IPV4_FAILURE_FATAL="yes" #interface name required by Topspin DEVICE="eth0" #the address of the physical NIC HWADDR="68:05:ca:0a:0b:0c" #Optionally, can reset MAC address here #MACADDR="00:30:66:77:88:99" IPADDR=172.25.111.11 GATEWAY=172.25.111.100 #i.e. netmask: PREFIX=24 IPV6INIT="no"
And with that, the external NIC should boot consistently with a name of eth0.
Richard, in this context, the CentOS 7 FAQ no.3 on bringing back the old network interface naming says the following for multiple interface cards :
“If you have multiple interfaces and want to control naming of each device rather than letting the kernel do in its own way, /etc/udev/rules.d/60-net.rules seems necessary to override /usr/lib/udev/rules.d/60-net.rules. ”
I am wondering if that provides a workaround to avoid the Kernel taking up the eth0 and eth1 names before the kernel boot options.
Rajan, the udev rules take effect late in the boot sequence, after the kernel names have already been applied. By setting biosdevname=0 in the kernel boot parameters, I disable this “consistent network names” feature of udev. Essentially, the only way to force the assignment of the interface names as needed by Topspin is to rename twice, first to free up the ethx names, and second to reassign these in the desired order. We could use udev rules for the second renaming, or a variety other means. I but I do this in the network-scripts config files.