Ethernet Interface names
- The Grub Bootloader needs a flag, to forget about the actual IF names.
1.1 for diskless nodes, add in file pxelinux.cfg/default
to the append line net.ifnames=0
1.2 on disk installations, update all files vim /etc/sysconfig/network-scripts/ifcfg-*
, update grub config /etc/default/grub
and add to the line GRUB_CMDLINE_LINUX at the end net.ifnames=0
, rebuild grub afterwards with grub2-mkconfig -o /boot/grub2/grub.cfg
# change computenode network interface names
cd /etc/sysconfig/network-scripts/
mv ifcfg-eth0 ifcfg-ethctrl
sed -i 's/eth0/ethctrl/' ifcfg-ethctrl
mv ifcfg-eth1 ifcfg-ethdata
sed -i 's/eth1/ethdata/' ifcfg-ethdata
# change grub
line=$(cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX")
linenew=$(echo ${line::-1}" net.ifnames=0\"")
echo "please change if not correct:"
echo $linenew
linenew=$(echo $linenew | sed 's/\//\\\//g')
sed -i 's/GRUB_CMDLINE_LINUX.*$/'"${linenew}"'/' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
- Tell udev to rewrite. Create
/etc/udev/rules.d/70-persistent-net.rules
with:
MAC_CTRL=$(cat ifcfg-ethctrl | grep HWADDR | cut -d'=' -f2)
MAC_DATA=$(cat ifcfg-ethdata | grep HWADDR | cut -d'=' -f2)
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'${MAC_CTRL}'", ATTR{type}=="1", KERNEL=="eth*", NAME="ethctrl"' > /etc/udev/rules.d/70-persistent-net.rules
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'${MAC_DATA}'", ATTR{type}=="1", KERNEL=="eth*", NAME="ethdata"' >> /etc/udev/rules.d/70-persistent-net.rules
Change the MAC address to the right ones ...