I was trying to connect 2 Ubuntu vms on virtualbox. they had the same ip address: 10.0.2.15 with default gate: 10.0.2.2
I tried to change this manually, and here what I did: on the edit connection tab, I changed the IPv4 settings where I chose Manual and added the ip address:192.168.0.2....... then I used the following to manually configure eth0:
sudo nano /etc/network/interfaces
I had only these 2 lines in the file:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
SO I ADDED THE FOLLOWING
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
broadcast .....
did ifconfig and eth0 inetaddress is showing 192.168.0.2
Now I need to undo that, I want it the way it was assigned 10.0.2.15 but I'm not able to do that, I changed the ipv4 settings back to Automatic dhcp and erased the ip I added. I erased what I have added in the interface file too.
Nothing changed, eth0 still have 192.168.0.2