PDA

View Full Version : [ubuntu] Switching to Dynamic IP from command line



wibbleberry
September 10th, 2008, 02:27 PM
I have an ubuntu server set up without a GUI and need to switch it from static to dynamic IP from the command line. I cannot download any packages as it was configured on a different router to the one I am using now. If it is more complicated than a few settings changes in config files I will have to make other arrangements. Anyone have a set of commands that can do this?

Titan8990
September 10th, 2008, 03:05 PM
jordan@bourne:~$ cat /etc/network/interfaces
\# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth1
iface eth0 inet manual


Change the word "manual" to "dhcp" under the interface you would like to change in the file /etc/network/interfaces

wibbleberry
September 10th, 2008, 04:07 PM
Brilliant. Had to go brush up on vi. Ta vm.

dcommini
September 14th, 2010, 08:58 PM
jordan@bourne:~$ cat /etc/network/interfaces
\# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth1
iface eth0 inet manual
Change the word "manual" to "dhcp" under the interface you would like to change in the file /etc/network/interfaces


Thank you for this! I changed mine over to static ip and lost my internet connection, switching back to dynamic helped.

pricetech
September 14th, 2010, 11:46 PM
Brilliant. Had to go brush up on vi. Ta vm.

nano is simpler.