How To Fix a missing eth0 adapter after moving HDD from one machine to another

Debian/Ubuntu Linux : How To Fix a missing eth0 adapter after moving HDD from one machine to another.

Explanation : Debian and Ubuntu write the MAC address of the ethernet adapter to a file that prevents the eth card in the new machine from being recognized. Delete the lines in this persistent-net.rules file and upon reboot, linux will see the new adapter and rewrite the persistent-net.rules file.

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

We want to delete the last 2 lines in this file

[arrow down] to place the cursor on – one at a time
# PCI device……………………………………….
SUBSYSTEM==”net”……………………………………
[dd] for each line (DELETEs LINE – that is – press the d key twice, the line should disappear)

Now we will save the file and exit the VIM editor with 3 characters (5 key strokes)
[Esc]:wq[Enter]

Reboot the machine – then type
[type] sudo ifconfig [enter]

You should now see the eth0 in the first 2 lines – looks something like :

eth0 Link encap:Ethernet HWaddr 00:22:19:dc:16:52
inet addr:10.10.10.1 Bcast:10.10.10.245 Mask:255.255.255.0

You may also like...