I'm configuring a "network", between two computers(both with ubuntu 12.04), using a crossover cable and assigning all ips by hand. When I set up an interface, with IP netmask etc, everything works, but in less than a minute ubuntu remove all my configuration and shows a message saying "activation of network connection failed". My guess is that it is trying to get the IPs via DHCP, but I'm not using anything of that. Anyone knows some way to disable that automatic configuration?
In Ubuntu the network configuration is managed by Network Manager. As you suspected, if you change your IP by hand (using ifconfig), as soon as it detects the change it will revert it.
You can either disable it or use it to change the ip configuration.
To disable Network Manager:
Or to stop the service
You can use nmcli to control Network Manager from the command line, including creating new connections or changing between them. Or you can just use the GUI, click on the network icon and select edit connections. There, you can either change the default connection or add another one with a fixed IP.