Virtualization

P2V Linux server network config

When you P2V Linux server network config, you may run into issues with network connectivity on your linux server VM. Let's look at steps to troubleshoot.

I wanted to write up a quick post of a few hurdles I went through with P2V’ing a linux web server that was also running cPanel. ย The P2V process worked as expected, however upon the first boot of the VM, I had issues with network connectivity. ย The P2V Linux server network config did not come over as expected. ย Let me walk you through a few of the issues.

P2V Linux server network config

When running a plain oldย ifconfig on the VM, this is the output I saw:

linuxP2V01

As you can see, I didn’t have any interfaces listed besides the loopback interface. ย At first when seeing this, I had driver issues running in my mind but let’s do some further checking. ย What gives? ย Well, I started diving in with a few handy commandline tools. ย Let’s see whatย ip link showย gives us.

ip link show

linuxP2V02

As you can see above, Iย do have interfaces besides just the loopback. ย So at this point I know that it is not a driver issue. ย The interfaces ARE there.

Okay, so let’s go back to the basics. ย Let’s compare what the interfaces look like on the physical server to the interfaces on the VM. ย Do you see a difference below? ย The interface names are different on the physical server compared to the VM. ย Upon boot, these wereย enumerated differently on the VM after it came up.

Physical box:

linuxP2V03

So the next step is to rename the interfaces on the VM (eth0 and eth1) back to theย eth2ย andย eth3 of the physical box to match the original configuration and hopefully get everything back up and running.

To do that we edit the following file:

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

Simply scroll to the end of the device line that correlates to your vmnic and you will see the “NAME=”eth0″ or whatever name it currently is. ย You can simply update the name of the interface to what you want it to be.

linuxP2V04

Steps:

  • Edit the file
  • Save the file
  • Reboot for changes to take effect.

More Troubleshooting

So I knew I had just found the silver bullet and I would see devices. ย However, after rebooting I still did not see any devices besides the loopback interface when issuing ifconfig.

However, I remembered, this was a P2V. ย So, the MAC addressย contained in the configuration file for the interfaceย wouldn’t match the new MAC address of the VMware vmnic. ย Is that hunch correct? ย Let’s see. ย All we have to do is look at the directory:

/etc/sysconfig/network-scripts

linuxP2V05

Edit the configuration file for the interface you are interested in. ย In my case, it is theย ifcfg-eth3 file. ย Now let’s look at the MAC address, which is noted asย HWADDR.

linuxP2V06

Sure enough! ย The MAC address I had in theย eth3 configuration file which came across in the P2V doesn’t not match the new VMware MAC address (which you can find in the VM configuration properties and clicking on the Network Adapter in question). ย So now, all I have left to do is change the MAC address, reboot and see if I can get the network to come up.

After rebooting and running theย ip link showย command. ย Voila! ย At last, network interface is showing asย UP. ย Just to verify, I am also now able to ping the box and have connectivity with the other devices on the network.

linuxP2V07

Final Thoughts

Be sure to include in your P2V time and plan of action, reconfiguring your network asย P2V Linux server network config may not come across. ย Dueย to the incorrect enumeration of the devices as well as to change the MAC address(es) most likely you may need to perform some if not all the steps mentioned above to once again have network connectivity, however, mileage may vary depending on your initial configuration as well as what you are trying to accomplish. ย In my case, having the identical configuration on the target VM was necessary.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.