NIC problems

Last modified: Sun Feb 12 14:58:17 EST 2017

Typical symptom:  a de minimis change to ethernet or WiFi hardware caused complete breakage of the network configuration at the OS level.

Udev tries to make sure that a given device name always maps to the same NIC.  That's a regression, not a feature.  What we want is for eth0 or wlan0 to always refer to THE NIC THAT ACTUALLY EXISTS so that downstream scripts and apps don't have to guess which device name is the working one today.  That was the behavior in the pre-udev days; udev screwed it up.

The following workarounds have been tested only on Slackware 14.2 and are unlikely to apply to any distro using systemd.

How to purge the MAC-to-name mapping and get back to eth0 or wlan0 for whatever you have installed:

  1. rm /etc/udev/rules.d/70-persistent-net.rules
  2. Reboot.

To stop MAC randomization from triggering udev on every reboot, insert this in rc.S prior to the initialization of udev, substituting your original MAC (if you remember it) for the xx:

echo Setting MAC to its original value
/sbin/ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx