Ubuntu – reset the computer’s ip address to dhcp from static

dhcpip

I have been running a file server on Ubuntu for a couple of years now. Recently I had to take the network down. When I brought it back up, my server lost its ip address from the router.

I can't remember how to put it back in the dhcp mode. I know that running a server in the dhcp mode isn't optimal, but my router won't allow me to assign static ip addresses. It will let me set a "forever" lease time which has worked just fine.

All I need to do is go dhcp on the server, find the ip address it has been assigned, and then set that as a static ip address on the server.

Again, it's not the optimal solution, but it was the one that worked. I would like to replace the router, but it has worked so well until now that I can't justify replacing it.

Any help is appreciated.

Best Answer

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo gedit /etc/network/interfaces

You will see this:

auto eth0
   iface eth0 inet static
   address 10.0.0.100
   netmask 255.255.255.0
   network 10.0.0.1
   broadcast 10.0.0.255
   gateway 46.185.128.91

Replace it with:

auto eth0
   iface eth0 inet dhcp

Then restart networking components.

sudo /etc/init.d/networking restart
Related Question