VMware Cloud Community
bunny101
Contributor
Contributor

Ubuntu upgrade trashed eth0 - but the config is still there

Good afternoon, all!

While on a short holiday, a colleague updated a VM from 14.04 to 16.04.  Problem is, the network interface is now gone - only from ifconfig. The VM settings show the original E1000 NIC and the /etc/network/interfaces is still there, pointing to eth0.

I seem to remember a network issue cloning a Linux VM, but nothing on the upgrade.

Anyone run into a similar issue?

Thanks!

Gregg

Tags (2)
0 Kudos
1 Reply
SterlingHealthc
Contributor
Contributor

Hi Gregg,  what may have happened is the network adapter got renamed with ubuntu 16.04.  Instead of the eth0 eth1 wording, the network driver I believe does the naming now. UDEV rules are no longer applied.

In my installs of Ubuntu 16.04 on ESXI6 with the vmxnet3, it is usually named: ens192

You can look in the /var/log/kern.log for the NIC and see what it was named. Search for eth0 and you will find something like this:

1310 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.431765] vmxnet3 0000:0b:00.0: # of Tx queues : 8, # of Rx queues : 8

1311 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.432856] vmxnet3 0000:0b:00.0: enabling device (0000 -> 0003)

1312 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.442876] vmxnet3 0000:0b:00.0 eth0: NIC Link is Up 10000 Mbps

1313 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.454702] AVX version of gcm_enc/dec engaged.

1314 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.458291] AES CTR mode by8 optimization enabled

1315 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.470336] [drm] DMA map mode: Using physical TTM page addresses.

1316 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.473643] [drm] Capabilities:

1317 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.474558] [drm]  Rect copy.

1318 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.475438] [drm]  Cursor.

1319 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.476313] [drm]  Cursor bypass.

1320 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.477200] [drm]  Cursor bypass 2.

1321 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.478058] [drm]  8bit emulation.

1322 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.478904] [drm]  Alpha cursor.

1323 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.479751] [drm]  Extended Fifo.

1324 Oct  5 20:52:23 cfpuprodapp01 kernel: [    1.480795] vmxnet3 0000:0b:00.0 ens192: renamed from eth0


The lines in red are the ones you want.  The bottom shows that the NIC was set to eth0, then renamed to ens192.

Once you find what it was renamed to, ifdown eth0, edit your /etc/network/interfaces file and replace eth0 with the renamed interface name.

Then ifup ens192 or whatever the new name is.


You might need to reboot. For some reason in 16.04, when I ifdown an interface, change the ip addr, then ifup the same interface.. It doesn't pick up the new address. systemctl restart networking does not pick up the new ip either.


I added an e1000 NIC to one of my Ubuntu servers and it got a name of ens33.


1450 Oct  6 14:40:58 cfpuprodapp01 kernel: [64131.274818] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI

1451 Oct  6 14:40:58 cfpuprodapp01 kernel: [64131.274823] e1000: Copyright (c) 1999-2006 Intel Corporation.

1452 Oct  6 14:40:58 cfpuprodapp01 kernel: [64131.283117] e1000 0000:02:01.0: enabling device (0100 -> 0103)

1453 Oct  6 14:40:59 cfpuprodapp01 kernel: [64131.670432] e1000 0000:02:01.0 eth0: (PCI:66MHz:32-bit) 00:50:56:ab:62:d2

1454 Oct  6 14:40:59 cfpuprodapp01 kernel: [64131.670442] e1000 0000:02:01.0 eth0: Intel(R) PRO/1000 Network Connection

1455 Oct  6 14:40:59 cfpuprodapp01 kernel: [64131.685636] e1000 0000:02:01.0 ens33: renamed from eth0

Good luck!

- Tom

0 Kudos