Network issue after Ubuntu Virtual Machine was copied from one computer to another

The problem is caused because Ubuntu ties ethernet devices to MAC addresses. When you generate a new UUID, the MAC address changes, Ubuntu doesn't know where to find the interface because the eth0 device that is loaded by the driver differs in MAC address from the device listed in the configuration.

Here are two simple commands to fix the problem:
# remove 70-persistent-cd.rules
sudo rm /etc/udev/rules.d/70-persistent-cd.rules
#reboot
sudo reboot
# do the following
\---- Start Script -
macaddr=`ifconfig -a | grep "HWaddr" | cut -d " " -f 11`
echo "eth0 mac $macaddr arp 1" > /etc/iftab
\---- End Script
ifconfig eth0 up
dhclient eth0
Sometimes, you may only need the last two steps.

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...