Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have Debian 6.0. In my interfaces file (/etc/network/interfaces) I have the following lines:

auto eth0
iface eth0 inet static
address 192.168.0.8
netmask 255.255.255.0
gateway 192.168.0.1

Everytime I start the computer, eth0 is not working.

When I enter ifconfig -a, eth0 is not "up" and "running".

I have to enter:

 ifconfig eth0 up
 /etc/init.d/networking restart

And then it works.

How do I have to change the config in order to have a working eth0 in the beginning?

share|improve this question
    
i guess it's related to your driver card.before ifconfig eth0 up use dmesg and see up it's alias names? –  Mohsen Pahlevanzadeh Sep 8 '12 at 22:03
    
What is the networking service status before restart? –  olivecoder Sep 9 '12 at 2:03
1  
Is there anything about eth0 in the system logs (/var/log/*)? If you run /etc/init.d/networking start while eth0 is down, do you get any error message? Is there another network interface (besides lo)? –  Gilles Sep 9 '12 at 20:04
2  
please put all of /etc/network/interfaces –  Mohsen Pahlevanzadeh Sep 9 '12 at 22:24
    
Please show the output of ifup -v eth0 after startup ? –  BatchyX Mar 13 '13 at 8:35

3 Answers 3

up vote 1 down vote accepted

How do I have to change the config in order to have a working "eth0" in the beginning?

Whenever I hear "in the beginning" it reminds of rc.local.

This is not really a direct answer for solving your problem but it seems that you're experiencing some difficulties with the driver.

For a quick fix, why not using rc.local? if your problem gets solved by typing those 2 commands every time you boot into your box then add them at the end of /etc/rc.local.

For an in-depth fix for your problem, first and before everything else do a:

apt-get update && apt-get upgrade

I had the same issue in my Backtrack, it solved after update. Apparently the same topic discussed here: Debian not starting eth0 at boot

share|improve this answer
    
Shouldn't that be apt-get update && apt-get upgrade or better apt-get update && apt-get dist-upgrade (for most practical purposes)? –  0xC0000022L Feb 10 '13 at 22:02

Is network service is enable at startup ?

Try using sysv-rc-conf Or rcconf tools

Or do it manually using :

sudo update-rc.d network defaults
share|improve this answer

Please check that it is not disabled in the networking-scripts configs. Do this:

sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0

See if ONBOOT="yes". If it says "no" then it is disabled at startup.

Here's my ifcfg-eth0 file as a reference:

DEVICE="eth0"
BOOTPROTO="static"
BROADCAST="192.168.254.255"
DNS1="192.168.254.25"
GATEWAY="192.168.254.254"
HWADDR="F2:24:08:AE:93:10"
IPADDR="192.168.254.236"
NETMASK="255.255.255.0"
ONBOOT="yes"
TYPE="Ethernet"

then do:

sudo service network restart

Ip address is not static set and won't change after reboot.

share|improve this answer
3  
Debian does not use sysconfig or redhat's configuration scripts. –  BatchyX Mar 13 '13 at 8:23
1  
it's for RHEL/CentOS/Fedora not for Debian based system's –  Rahul Patil Apr 12 '13 at 4:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.