After a hardware change (either network interface or motherboard), the network interfaces can be missing. This guide describe how to fix this issue.

This howto is tested on:

  • Debian 8.0 Jessie

Fixing the issue

Detect if sudo is available (“command” is used if not):

cmdProxy='command'
command type -f 'sudo' &>'/dev/null' && cmdProxy='sudo'

Udev manage a cache of the system’s network interfaces’ MAC addresses. The MAC address is linked to the network hardware. When changing hardware, the MAC address changes, and the network interface can not be created. To solve this issue, empty the Udev MAC addresses cache:

[ -e "/etc/udev/rules.d/z25_persistent-net.rules" ] \
  && ${cmdProxy} tee "/etc/udev/rules.d/z25_persistent-net.rules" <<< ""
[ -e "/etc/udev/rules.d/70-persistent-net.rules" ] \
  && ${cmdProxy} tee "/etc/udev/rules.d/70-persistent-net.rules" <<< ""


Reboot the system to force the recreation of the MAC addresses cache by Udev with the new hardware detected.

Thanks

Categories: Setup

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.