I am working with Digital Ocean and their help team is unable after over a dozen emails to help me register the network on a VPS spun up from their backup image. Their instructions to try to change grub so a network device showing as ens3 will show as eth0 are not working. I need to stop it from being renamed as ens3 so I can follow their instructions for configuring the eth0 as a static IP.
$ dmesg | grep -i eth
[ 8.676459] virtio_net virtio0 ens3: renamed from eth0
The output from
$ ip addr show
Their instructions that I have completed without errors from grub were:
Open the file "/etc/default/grub.d/50-cloudimg-settings.cfg" with your favorite text editor, such as vim. Look for the line that says "GRUB_CMDLINE_LINUX_DEFAULT" and add "net.ifnames=0" at the end of the line, within the quotations. It should look like this afterward:
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0 net.ifnames=0"
Save and close the file
Update GRUB with the new settings and reboot the Droplet by running these commands:
$ update-grub
$ reboot
I have done that, and also followed similar instructions again without success at https://www.itzgeek.com/how-tos/mini-howtos/change-default-network-name-ens33-to-old-eth0-on-ubuntu-16-04.html
Edit: based on comments especially from @Terrance and also @Stephen Boston, this file seems likely problematic, but I am not sure what to change it to:
$ cat /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="72:9d:39:b5:f6:ef", NAME="ens3"
(There are no other files in that dir.)
Is the ATTR the MAC address? The value in this file is the one that showed up above in ip addr show for ens3. How would I determine what it should be. Question: Is the single = after NAME instead of double == causing a problem?
Once I get ens3 to be just eth0 I think the rest is simple. (FWIW whereis netplan shows no results, there is no /etc/netplan directory and I am not really a sysadmin.)
/etc/udev/rules.d/
folder? I wonder if there is a70-persistent
file in there setting it to another name with maybe the wrong MAC. – Terrance Apr 21 '21 at 22:33