{"id":280,"date":"2018-03-15T16:07:59","date_gmt":"2018-03-15T23:07:59","guid":{"rendered":"http:\/\/staff.washington.edu\/ketcham\/?p=280"},"modified":"2019-04-12T11:46:55","modified_gmt":"2019-04-12T18:46:55","slug":"centos-7-workarounds-for-old-topspin","status":"publish","type":"post","link":"https:\/\/staff.washington.edu\/ketcham\/centos-7-workarounds-for-old-topspin\/","title":{"rendered":"CentOS 7 Workarounds for old Topspin"},"content":{"rendered":"<p>Here are descriptions of some workarounds we developed to allow old versions of Bruker Topspin\u2122 to run on CentOS 7.<\/p>\n<h3>Network Interface Names<\/h3>\n<p>The old traditional interface names are hard coded into old versions of of Topspin.\u00a0 The software expects that an interface named &#8220;eth0&#8221; will be the external (i.e. public) network interface and eth1 will be the internal interface, connecting to the NMR console hardware.\u00a0 The Bruker\/Flexlm license manager uses the MAC address of eth0 for license validation.<\/p>\n<p>Under modern linux with systemd startup manager, startup is multithreaded.\u00a0 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.\u00a0 Normally this is not a problem, due to <a href=\"https:\/\/en.wikipedia.org\/wiki\/Consistent_Network_Device_Naming\">Consistent Network Device Naming<\/a> by which these devices get renamed to modern style names derived from physical bus and slot numbers of the NIC.\u00a0 However,\u00a0 because the network names &#8220;eth0&#8221; and &#8220;eth1&#8221; are hard coded into Topspin, we need to rename the NIC interfaces accordingly.\u00a0 There are <a href=\"https:\/\/access.redhat.com\/discussions\/916973\">a few ways<\/a> to disabling Consistent Network Device Naming.\u00a0 This results in old-style network interface names.\u00a0 However, the names &#8220;eth0&#8221; and &#8220;eth1&#8221; might be assigned to the internal or external interface in either order, varying from one boot to another.<\/p>\n<p>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 <em>except<\/em> for the names we needed.\u00a0 The problem was that these kernel names. eth0 and eth1, are <em>in use <\/em>already, as these names get bound to the interfaces early in the boot process.\u00a0 So first the interfaces must be renamed to anything other than the default kernel names, so as to free these eth<em>n<\/em> names to make them available for assignment.<\/p>\n<p>There are several ways to accomplish this.\u00a0 I describe only the method I finally chose to use.\u00a0 I want to set the alternate network names early in the boot process, so I configure it in the initrd (initial ramdisk) image.<\/p>\n<p>I create a dracut configuration file, assigning the alternate interface names to my network interfaces, identified by their the MAC hardware addresses.\u00a0 Then I rebuild the initrd image.<\/p>\n<pre style=\"padding-left: 30px;\">bash-4.2# cat \/etc\/dracut.conf.d\/netnames.conf\r\n\r\nifname=net0:68:05:ca:0a:0b:0c\r\n ifname=net1:78:45:c4:11:22:33\r\n biosdevname=0\r\n\r\nbash-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<\/pre>\n<p>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.<\/p>\n<p>Also I insert this line into \/etc\/default\/grub<\/p>\n<pre>GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"<\/pre>\n<p>and remake grub.cfg\u00a0 with \/usr\/sbin\/grub2-mkconfig.<\/p>\n<p>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.\u00a0 I don&#8217;t want NM to overwrite my customizations:<\/p>\n<pre>bash-4.2# systemctl stop NetworkManager\r\nbash-4.2# systemctl disable NetworkManager\r\nbash-4.2# yum remove NetworkManager<\/pre>\n<p>I will replace NM with the old-style &#8220;network&#8221; initscript<\/p>\n<pre>bash-4.2# yum install initscripts\r\nbash-4.2# systemctl enable network\r\nbash-4.2# systemctl start network<\/pre>\n<p>&nbsp;<\/p>\n<p>Topspin requires that we rename the external interface, temporarily named net0, to eth0.\u00a0 I create \/etc\/sysconfig\/network-scripts\/ifcfg-etch0 with the following lines<\/p>\n<pre>bash-4.2# cat ifcfg-eth0 \r\nBOOTPROTO=none\r\nONBOOT=yes\r\nDEFROUTE=\"yes\"\r\nIPV4_FAILURE_FATAL=\"yes\"\r\n\r\n#interface name required by Topspin\r\nDEVICE=\"eth0\"\r\n\r\n#the address of the physical NIC\r\nHWADDR=\"68:05:ca:0a:0b:0c\"\r\n\r\n#Optionally, can reset MAC address here\r\n#MACADDR=\"00:30:66:77:88:99\"\r\n\r\nIPADDR=172.25.111.11\r\nGATEWAY=172.25.111.100\r\n#i.e. netmask: \r\nPREFIX=24\r\nIPV6INIT=\"no\"\r\n\r\n<\/pre>\n<p>And with that, the external NIC should boot consistently with a name of eth0.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are descriptions of some workarounds we developed to allow old versions of Bruker Topspin\u2122 to run on CentOS 7. Network Interface Names The old traditional interface names are hard coded into old versions of of Topspin.\u00a0 The software expects that an interface named &#8220;eth0&#8221; will be the external (i.e. public) network interface and eth1&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/staff.washington.edu\/ketcham\/centos-7-workarounds-for-old-topspin\/\">Read More<i class=\"fa fa-angle-right\"><\/i><\/a><\/div>\n<p><br class=\"clear\" \/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/posts\/280"}],"collection":[{"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/comments?post=280"}],"version-history":[{"count":9,"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/posts\/280\/revisions"}],"predecessor-version":[{"id":358,"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/posts\/280\/revisions\/358"}],"wp:attachment":[{"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/media?parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/categories?post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staff.washington.edu\/ketcham\/wp-json\/wp\/v2\/tags?post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}