Configuring Wired Network Interface to Rename as eth0

After installing Debian 12.9.0, the network interface name might be something like
enP3p49s0on the first boot. This naming convention can be cumbersome to work with. You can change the interface name toeth0by following the steps below.Note: GRUB configuration is for X86 devices only.
Check the Current Network Interface Name
Use the following command to check the current network interface name:
root@Debian:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: enP3p49s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
Modify the GRUB Configuration
-
Edit the GRUB configuration file:
vim /etc/default/grub -
Add
net.ifnames=0 biosdevname=0to theGRUB_CMDLINE_LINUXline:GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
Modify the Network Interface Configuration File
Edit the network interfaces file vim /etc/network/interfaces to configure a dynamic or static IP.
Dynamic IP Configuration
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto
Static IP Configuration (You can add eth1, eth2, etc., for multiple interfaces)
allow-hotplug eth1
iface eth1 inet static
address 192.168.1.2
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 192.168.1.1
Apply the Configuration and Reboot
Execute the following commands to apply the configuration:
grub-mkconfig -o /boot/grub/grub.cfg
update-grub
reboot
Verify the Configuration
After rebooting, use the following command to verify that the network interface name has been changed to eth0:
root@Debian:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
Now you can use it conveniently!