IP address and subnet lost after reboot

Report bugs and workarounds
Post Reply
alexanderbrix
Posts: 35
Joined: 20 Oct 2016 06:09

IP address and subnet lost after reboot

Post by alexanderbrix »

Hi community,
I saw this "bug" for several times now.
If I restart the EFA server after updating or for other reasons I can't connect to the webinterface after the restart.
So I change directly to the VM and I can verify that there is no IP address and no subnet mask anymore. So I type it in again and everything is fine again.
But why does EFA lose the IP addresses every restart?

Thanks in advance!
Alex
largo
Posts: 22
Joined: 15 Nov 2016 08:49

Re: IP address and subnet lost after reboot

Post by largo »

Hi
I have the same problem.
/Largo
TheGr8Wonder
Posts: 97
Joined: 01 Jul 2017 02:32

Re: IP address and subnet lost after reboot

Post by TheGr8Wonder »

Which hyper-visor are you using? Was the VM based from a template or installed fresh via the build script?
alexanderbrix
Posts: 35
Joined: 20 Oct 2016 06:09

Re: IP address and subnet lost after reboot

Post by alexanderbrix »

Which hyper-visor are you using?
We are on MS Hyper-V.
Was the VM based from a template or installed fresh via the build script?
I don't know since someone else installed this for us...
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: IP address and subnet lost after reboot

Post by pdwalker »

Check the hypervisor vm settings. Is the virtual network adapter set to connect at boot automatically?
alexanderbrix
Posts: 35
Joined: 20 Oct 2016 06:09

Re: IP address and subnet lost after reboot

Post by alexanderbrix »

yes it is
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: IP address and subnet lost after reboot

Post by pdwalker »

All I can suggest is to look at the dmesg logs to see if you can work out why the ethernet address is being lost.

What are the contents of your /etc/sysconfig/network-scripts/ directory in your EFA box? What are the contents of the file ifcfg-eth0, if there is one in that directory.
alexanderbrix
Posts: 35
Joined: 20 Oct 2016 06:09

Re: IP address and subnet lost after reboot

Post by alexanderbrix »

here you can see the content of ifcfg-eth0
Attachments
00000.jpg
00000.jpg (31.04 KiB) Viewed 9538 times
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: IP address and subnet lost after reboot

Post by pdwalker »

and can you find anything related to eth0 in your dmesg logs?

do a "dmesg | grep eth0" to find the name of your network adapter advice (mine is vmxnet3) and then do a "dmesg | grep <network adapter device name>" and tell us what shows up.
alexanderbrix
Posts: 35
Joined: 20 Oct 2016 06:09

Re: IP address and subnet lost after reboot

Post by alexanderbrix »

it shows me:

Code: Select all

udev: renamed network interface eth0 to eth5
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: IP address and subnet lost after reboot

Post by pdwalker »

And there is your problem.

Because you are trying to configure eth0, but your system is renaming the interface to eth5.

Why is it renaming your ethernet device? No idea. Maybe the vm was migrated from one system to another, maybe some previous admin was doing weird things. Magic 8-ball says, "uncertain, ask again later".

The file to check now is the one called "/etc/udev/rules.d/70-persistent-net.rules". Show me the contents of this file and we'll see if we can get a step closer to figuring out your problem. This file is responsible for maintaining the persistent names of network devices in your system.
alexanderbrix
Posts: 35
Joined: 20 Oct 2016 06:09

Re: IP address and subnet lost after reboot

Post by alexanderbrix »

Thank you so far for your help!

Here is the content of the file "70-persistent-net.rules"

Code: Select all

# 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.

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:19:15:2c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:17:04:29", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:17:65:2e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:17:04:33", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:19:15:31", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:17:65:3f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: IP address and subnet lost after reboot

Post by pdwalker »

Does your vm have 6 Ethernet adapters? If not, find out which entry has the servers network MAC address (should be the one listed as eth5) and delete the other entries. Change eth5 to eth0 and reboot.

If you have more than one network cad installed for the vm, then keep and rename the entries as appropriate.

If you only have one network card, delete this file and reboot. The system will regenerate it and your single card will come up as eth0 with the expected IP address.
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: IP address and subnet lost after reboot

Post by henk »

One way to avoid this behavior: you can use manual mac assignment within the virtual machine. Just use some logic to prevent conflicts (duplicates) when calculating the mac address(ses).

To circumvent the limit of 256 virtual network adapters per physical machine and possible MAC address conflicts between virtual machines, system administrators can manually assign MAC addresses. VMware uses the Organizationally Unique Identifier (OUI) 00:50:56 for manually generated addresses.

The MAC address range is 00:50:56:00:00:00-00:50:56:3F:FF:FF.
You can set the addresses by adding the following line to a virtual machine‘s configuration file:

ethernet<number>.address = 00:50:56:XX:YY:ZZ

where <number> refers to the number of the Ethernet adapter, XX is a valid hexadecimal number between 00 and 3F, and YY and ZZ are valid hexadecimal numbers between 00 and FF. The value for XX must not be greater than 3F to avoid conflict with MAC addresses that are generated by the VMware Workstation and VMware Server products. The maximum value for a manually generated MAC address is:
ethernet<number>.address = 00:50:56:3F:FF:FF

You must also set the option in a virtual machine’s configuration file:
ethernet<number>.addressType="static"

Because VMware ESX virtual machines do not support arbitrary MAC addresses, you must use the above format. As long as you choose a unique value for XX:YY:ZZ among your hard-coded addresses, conflicts between the automatically assigned MAC addresses and the manually assigned ones should never occur.
Attachments
vmware1.png
vmware1.png (12.59 KiB) Viewed 9525 times
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
alexanderbrix
Posts: 35
Joined: 20 Oct 2016 06:09

Re: IP address and subnet lost after reboot

Post by alexanderbrix »

Thank you very much. I deleted the file and restarted the VM. Also I set a static MAC address.
My new "70-persistent-net.rules" looks like this:

Code: Select all

# 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.

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:17:65:3f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
This is the MAC address I set in the VM settings.
The IP address was still there after my reboot ;-)

So I hope the problem is solved - thank you very much!
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: IP address and subnet lost after reboot

Post by pdwalker »

Yeah, your problem is solved. Glad to hear it.

For what it is worth, I normally let the vm host software decide what the mac address is, and if I have a problem with the ethernet device being renamed, I just delete the 70-persistent-net.rules file and reboot.

It's only under unusual circumstances where I need to specify an MAC address explicitly.
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: IP address and subnet lost after reboot

Post by henk »

Hi Alexander,

On vmware, when setting the mac address, you should use the : 02:50:56 prefix. No idea with MS Hyper-V.
If you are not sure, I would just use the pdwalker solution and remove the manual mac address to prevent strange situations in the future and blame 'someone else' :whistle:

@pdwalker
I agree that normally this is not the way to go. This happens when you copy or move the vm. The best option is to install EFA from the image provided by efa.
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
Post Reply