Ubuntu: Ubuntu Server 12.10 not obtaining IP address until a user logs in



Question:

I just did a recent install of Ubuntu Server 12.10 (no GUI, command line only) on a new system. I noticed that upon booting the server does not obtain an IP address from my router. However, once I log into the machine locally the server shows up on my list of DCHP clients and I can connect remotely without issue. After some initial research, I looked at my /etc/network/interfaces/

# The loopback network interface  auto lo eth0  iface lo inet loopback    # The primary network interface  iface eth0 inet dhcp  

Others who had similar issues usually were missing either "auto eth0" or the "dhcp" and were able to fix their problem by adding those lines in. My set up seems to be fine the way it is.

Next up, I tried looking at /etc/local.rc and made two different attempts for the server to add eth0 on boot:

Attempt #1

ifup eth0  exit 0  

Attempt #2

dhclient eth0  exit 0  

Yet neither of these changes caused the server to obtain IP before an initial local login. Since I'm trying to run this server headless, being able to remotely login upon boot is pretty important for my needs. Any insight would be greatly appreciated since most forums suggest to make the changes that I've already tried. Thanks for your help.


Solution:1

I've never seen more than one device named on an auto line before. This could be a dud suggestion but try this instead:

auto lo   iface lo inet loopback    auto eth0  iface eth0 inet dhcp  

And also check that it is eth0 and not eth1 or eth2. Probably nothing but it doesn't hurt to double-check.

$ ifconfig -a | grep eth  eth0      Link encap:Ethernet  HWaddr aa:bb:cc:dd:ee:ff  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »