I'm using Ubuntu on VirtualBox, but I think this is not important in my case.
When I use the command
the interface works as expected, in fact I can ping other (virtual) machines on the same subnet.
sudo ifconfig eth1 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255 up
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 is
As you can see, the line of the ipv4 configuration is absent.
Why? How can I resolve?