I'm using Ubuntu on VirtualBox, but I think this is not important in my case.

When I use the command
sudo ifconfig eth1 netmask broadcast up
the interface works as expected, in fact I can ping other (virtual) machines on the same subnet.

But after a while (even if I don't perform any action) seems like the interface "loses" its ipv4 configuration, in fact the output of

As you can see, the line of the ipv4 configuration is absent.

Why? How can I resolve?