top of page

Corrigindo problemas de interface de rede após clonar uma máquina virtual Linux

Ao clonar uma máquina virtual Linux em um ambiente VMware a interface de rede eth0 pode ficar inexistente, acontece que quando você faz o clone a interface de rede da máquina recebe um novo endereço MAC (que é claro, deve trabalhar na mesma LAN).

Em muitas distribuições Linux o endereço MAC fica em um cache, em um sistema Linux geralmente o arquivo é esse:

/etc/udev/rules.d/70-persistent-net.rules


Após a clonagem, ele irá incluir uma referência à interface de rede antiga como eth0.


Saída do arquivo 70-persistent-net.rules:


# This file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.

# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:b6:33:f9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x15ad:0x07b0 (vmxnet3)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bd:00:4e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

A maneira mais fácil de resolver este problema é simplesmente excluir o arquivo.


rm /etc/udev/rules.d/70-persistent-net.rules


Depois de excluir o arquivo, você precisa reiniciar.


Após a reinicialização o comando ifconfig -a deve mostrar a eth0 e tudo deve funcionar.


Você também pode editar o arquivo para remover a antiga referência a interface eth0, simplesmente renomeie eth1 para eth0.


Na minha opinião excluir o arquivo e reiniciar parece mais conveniente.


Posts Destacados
Posts Recentes
Procure por Tags
Nenhum tag.
Siga
  • Google+ Long Shadow
  • Facebook Long Shadow
  • LinkedIn Long Shadow
  • Twitter Long Shadow
bottom of page