no ip linux

C++
Get 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++: