You must be disabled NetworkManager service in Ubuntu when you setup IP address from command line .
Stop Service
$sudo systemctl stop NetworkManager
Disable service permanently
$ sudo systemctl disable NetworkManager
Note: after disable of service your interface will be down. Now configure IP address from CLI .
Stop Service
$sudo systemctl stop NetworkManager
Disable service permanently
$ sudo systemctl disable NetworkManager
Note: after disable of service your interface will be down. Now configure IP address from CLI .