new ip linux

C++
$ sudo dhclient -r
$ sudo dhclientGet new ip from DHCP (If not working, check your connection to router)
//Release ip
sudo dhclient -r [Interface name](optional)

//Renew ip
sudo dhclient [Interface name](optional)
Source

Also in C++: