Skip to content

Instantly share code, notes, and snippets.

@sven-bock
Created December 7, 2018 11:15
Show Gist options
  • Save sven-bock/9069164551fbc63d3ca286650ad8bf67 to your computer and use it in GitHub Desktop.
Save sven-bock/9069164551fbc63d3ca286650ad8bf67 to your computer and use it in GitHub Desktop.
Rename a network device (Ubuntu 16.04)
#Create a file called
/etc/udev/rules.d/70-persistent-net.rules
#Add this and replace address and name:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:01:02:03:04:05", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"
#Modify the grub configuration
/etc/default/grub
# Replace this line
GRUB_CMDLINE_LINUX=""
# with
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
# Upgrade your grub and reboot
sudo update-grub
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment