• Register
Home  //  Techbauchery  //  OS and Applications  //  Linux  //  ethX not active at boot

While some installs work exactly the way you expect them to, there are times when things don't always go as planned. One of these times is the inability for eth0 or eth1 to become active at boot. A simple ifup ethX will fix the problem but who wants to do that EVERY time you reboot a server? I surely don't. First, a little information. I was working with a CLI install of Debian 6 (as a VM) and the install went very smooth. No issues or hiccups. The VM rebooted and I tried to SSH in. Not happening. I checked the ifconfig info and only lo was active. ifup eth0 and then adapter is now active, I have an IP address and can SSH in. Maybe it was a fluke? I reboot and again eth0 is inactive. I decided to edit the interfaces file.

/etc/network/interfaces

BEFORE
# The primary network interface
auto eth0
iface eth0 inet dhcp


AFTER
# The primary network interface
auto eth0
iface eth0 inet static
address 192.5.1.150
netmask 255.255.255.0
network 192.5.1.0
gateway 192.5.1.1

I saved the changes and rebooted. Still eth0 was inactive. I use ifup again and again eth0 becomes active. I verify that I entered the correct information into the interfaces file. While I have it open, I add the following line into the interfaces file and reboot. Eth0 is now active at boot.

allow-hotplug eth0

FINAL
# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.5.1.150
netmask 255.255.255.0
network 192.5.1.0
gateway 192.5.1.1

The auto eth0 should bring up eth0 at boot but in my case, that wasn't happening. The added line allow-hotplug eth0 fixed my issue.