20120620

GNU/Linux: Renombrar interfaz de red - GNU/Linux: Rename network interface

Hoy he clonado una máquina con VMWare para montar un cluster, y resulta que en la máquina resultante las interfaces tenían los nombres eth2 y eth3. Para poder aprovechar en lo posible la configuración de la máquina origen de la clonación, he procedido a cambiar los nombres de las interfaces con el siguiente comando:
ip link set dev nombre_actual name nuevo_nombre

Así, en mi caso sería:
ip link set dev eth2 name eth0
ip link set dev eth3 name eth1

Si lo que queremos es que los cambios se mantengan después de reiniciar el sistema, sólo debemos editar el siguiente fichero de configuración:
/etc/udev/rules.d/70-persistent-net.rules

Donde únicamente podemos cambiar el valor de la etiqueta NAME según indica un cometnario en el mismo fichero.
A que mola!!


Today I cloned a machine using VMWare to set up a cluster and at the destination machine had eth2 and eth3 as network interfaces name instead of eth0 and eth1. As I want to use the source machine configuration as much as possible I have changed the interfaces name with the following command:
ip link set dev current_name name new_name

So in this case I have typed:
ip link set dev eth2 name eth0
ip link set dev eth3 name eth1

If we want to make these changes permanent after a reboot, we have to edit the following config file:
/etc/udev/rules.d/70-persistent-net.rules

where we can only change the NAME key as is warned in the file.
Cool!!

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.