change ip of ubuntu

C++
sudo ip link set dev eth0 up
sudo dhclient -v eth0
Source

Also in C++: