You are probably using a Linux distribution that uses the NetworkManager
daemon, and during installation it decided that eth0 should be configured via DHCP. So every time you manually setup its IP not using it (from a terminal in your case), NetworkManager
will set it up again without noticing you within a few seconds or minutes.
To check if you have indeed NetworkManager
running and managing eth0 setup, issue:
ps aux | grep -i networkmanager
If it is indeed running, look for more info about it, from Ubuntu for instance:
https://help.ubuntu.com/community/NetworkManager
...and then google around for "network manager manual setup ip".
PS:
I hate NetworkManager
with a deep passion, gave up using it years ago and always uninstall it, managing my interfaces manually and/or the good old /etc/network/interfaces
way. Noticeably (in my case) it can be a pure nuisance when multihoming and changing the interfaceS setup frequently. So if this is indeed your problem (90% sure) I can't help you much more with it. NetworkManager
is good at managing one interface at a time, with one configuration (ex static or DHCP) for each interface. This satisfy 95% of user cases. But not mine.