# Network drops on boot [SOLVED]

## HeXiLeD

Hi 

This is an old issue and it has happend to me on at least 3 boxes.

It very simple to explain but it seems hard to fix.

here is an example

Currently in one box  i have tested this with gentoo-sources and vanilla-sources.

i have compiled 8139too  as module and added it to

```
/etc/modules.autoload.d/kernel-2.6
```

i also added it to:

```
rc-update add net.eth0 default
```

After boot the card works but...

here's what happens :

rc-update  brings the eth0 up but right away its drops it and the only way i can get it to stay up is to add:

```
/etc/init.d/net.eth0 restart
```

to:

```
/etc/conf.d/local.start
```

and this way  i can go online right away.

But again ... something is not 100% right because:

```
# lsmod

Module                  Size      Used by

8139too                24320    0

```

...shows me  that  the module is not being used.

I have tried to compile this driver as built-in the kernel and no luck to make it work.

This puzzles me because i've got  the problem in 3 different boxes.

Any ideas and more than welcome and thank you for the attention

----------

## linear

 *Blue-Steel wrote:*   

> rc-update brings the eth0 up but right away its drops it...

 

Okay, what does your system logger say is going on?  Is there any mention of an error in /var/log/messages (or whereever your logger is putting system messages).  And what do you see when you do a 'dmesg'?

 *Blue-Steel wrote:*   

> But again ... something is not 100% right because:
> 
> ```
> 
> # lsmod
> ...

 

Not being used by another module...    :Wink:    Take a look at part of the lsmod of one of our test systems here:

```
$ lsmod

Module                  Size  Used by    Not tainted

parport_pc             24712   1 (autoclean)

lp                      7240   0 (autoclean)

parport                23432   1 (autoclean) [parport_pc lp]

i810-tco                3156   0 (unused)

jedec_probe             9264   0 (autoclean)

gen_probe               2080   0 (autoclean) [jedec_probe]

chipreg                  841   0 [jedec_probe]

snd-ens1371            12324   0 (unused)

gameport                1388   0 [snd-ens1371]

snd-pcm                55880   0 [snd-ens1371]

snd-timer              14596   0 [snd-pcm]

snd-rawmidi            13380   0 [snd-ens1371]

snd-seq-device          3744   0 [snd-rawmidi]

snd-ac97-codec         48592   0 [snd-ens1371]

snd                    32196   0 [snd-ens1371 snd-pcm snd-timer snd-rawmidi snd-seq-device snd-ac97-codec]

snd-page-alloc          4716   0 [snd-pcm snd-timer snd-rawmidi snd-seq-device snd]

soundcore               3588   2 [snd]

hid                    20548   0 (unused)

sbp2                   16468   0 (unused)

ieee1394              181316   0 [sbp2]

usb-storage           107632   0 (unused)

input                   3264   0 [hid]

uhci                   25276   0 (unused)

usbcore                58156   1 [hid usb-storage uhci]
```

It's showing which modules are being used by other modules.  

So, for now, let's see if we can find any error output regarding the card first.  Does /var/log/messages or dmesg say anything about the card?

Let us know.

/bk

----------

## HeXiLeD

```

device eth0 entered promiscuous mode

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

rc-scripts: ERROR:  problems stopping dependent services.

rc-scripts:         "net.eth0" is still up.

rc-scripts: WARNING:  "net.eth0" has already been started.

8139too Fast Ethernet driver 0.9.27

eth0: RealTek RTL8139 at 0xffffc200103bc400, 00:50:fc:78:ea:ed, IRQ 66

eth0:  Identified 8139 chip type 'RTL-8100B/8139D'

eth0: no IPv6 routers present

eth0: Promiscuous mode enabled.

device eth0 entered promiscuous mode

```

----------

## linear

Interesting output... I imagine this is a snippet from dmesg?  Or is this from /var/log/messages? 

Well, one question that comes to mind quickly is:

"What is this box going to be used for and do you need the network card to be in promiscuous mode?"

As a quick reference, setting a network interface card to promiscuous mode allows that network card to pass *all* packets that it receives to the CPU instead of just the ones that are addressed to it.  This is usually done by systems that are used as network monitors and/or packet sniffers.  Not something you need, or even want to do on your average workstation.

 *Blue-Steel wrote:*   

> here is an example
> 
> Currently in one box i have tested this with gentoo-sources and vanilla-sources.
> 
> i have compiled 8139too as module and added it to
> ...

 

So, you are saying that you compiled the driver as a module from building the gentoo-sources kernel and used the module source from the kernel source tree, correct?   I'm trying to make sure I understand exactly what is going on here so I can give the right info.     :Smile: 

And, with that in mind, try typing the following commands as root and post the results up here:

```
# rc-update show

# grep '[use,need] net' /etc/init.d/* 
```

I'm really curious as to what the dependency is that it can't stop.

/bk

----------

## HeXiLeD

 *Quote:*   

> I imagine this is a snippet from dmesg? Or is this from /var/log/messages? 

 

Its from /var/log/messages but i remember dmesg showing detailed info using the words "drop network on eth0"

 *Quote:*   

> "What is this box going to be used for and do you need the network card to be in promiscuous mode?

 

The box is a desktop/server and as far as the promiscuous mode goes; well... i never picked it like that. thats how it all started to work since the install.

I have compiled this driver as module in gentoo-sources and vanilla-sources kernel. Currently im using vanilla-sources.

```

acpid |      default

alsasound |      default

apache2 |      default

arpwatch |      default

autoconfig | boot

bluetooth |

bootmisc | boot

checkfs | boot

checkroot | boot

clamd |      default

clock | boot

coldplug | boot

consolefont | boot

crypto-loop |

cupsd |      default

dbus | boot

domainname |      default

esound | boot

famd |

gkrellmd |

gpm | boot

hald |      default

hdparm | boot

hostname | boot

hotplug |      default

ip6tables |

iptables |

ivman |

keymaps | boot

kismet |

kudzu |      default

lircd |

lircmd |

local |      default nonetwork

localmount | boot

mldonkey |

modules | boot

nas |

nessusd |

net.eth0 |      default

net.lo | boot

net.ppp0 |

net.wlan0 |

netmount |      default

noip | boot default

nscd |

numlock |      default

nvtv |

openvpn |

pktcdvd | boot

portmap |

proftpd |

pwcheck |

reslisa |

ptlink-ircd |

ptlink-services |

pwcheck |

reslisa |

rmnologin | boot

rp-pppoe |

rsyncd |

samba |

saslauthd |

serial | boot

shoutcast |

shoutcast_trans |

slapd |

slurpd |

smartd |

spind |

splash |

sshd |      default

syslog-ng |      default

timidity |

urandom | boot

usbd |      default

ut2004-ded |

vixie-cron |      default

vmware | boot

xdm |      default

xfs |

xinetd |      default

```

```
# grep '[use,need] net' /etc/init.d/*

/etc/init.d/apache2:    need net

/etc/init.d/arpwatch:   need net

/etc/init.d/autoconfig: before net

/etc/init.d/clamd:      use net

/etc/init.d/cupsd:      use net

/etc/init.d/esound:     use net portmap alsasound

/etc/init.d/gkrellmd:   need net

/etc/init.d/ip6tables:  before net

/etc/init.d/iptables:   before net

/etc/init.d/mldonkey:   need net

/etc/init.d/nas:        need net

/etc/init.d/nessusd:    need net

/etc/init.d/net.eth0:# runlevel as the net.* script that needs it.

/etc/init.d/net.eth0:# One example of this is essidnet which configures network

/etc/init.d/net.eth0:           eerror "root filesystem is network mounted -- can't stop ${iface}"

/etc/init.d/net.lo:# runlevel as the net.* script that needs it.

/etc/init.d/net.lo:# One example of this is essidnet which configures network

/etc/init.d/net.lo:             eerror "root filesystem is network mounted -- can't stop ${iface}"

/etc/init.d/net.wlan0:# runlevel as the net.* script that needs it.

/etc/init.d/net.wlan0:# One example of this is essidnet which configures network

/etc/init.d/net.wlan0:          eerror "root filesystem is network mounted -- can't stop ${iface}"

/etc/init.d/noip:       need net

/etc/init.d/openvpn:    need net

/etc/init.d/portmap:    use net

/etc/init.d/proftpd:    need net

/etc/init.d/ptlink-ircd:        need net

/etc/init.d/ptlink-services:    need net

/etc/init.d/reslisa:    use net

/etc/init.d/rp-pppoe:   use net

/etc/init.d/rsyncd:     use net

/etc/init.d/runscript.sh:# Set $IFACE to the name of the network interface if it is a 'net.*' script

/etc/init.d/samba:      need net

/etc/init.d/saslauthd:  need net

/etc/init.d/slapd:      need net

/etc/init.d/slurpd:     need net

/etc/init.d/sshd:       need net

/etc/init.d/syslog-ng:  # Make networking dependency conditional on configuration

/etc/init.d/syslog-ng:                  need net ;;

/etc/init.d/ut2004-ded:        need net

/etc/init.d/xinetd:     use net

```

----------

## linear

Sorry about the delay on this response.  Work has really been busy as of late  :-/

You certainly have a lot of things loaded and/or running on your system.

The promiscuous mode most likely comes from arpwatch.  Both arpwatch and nessusd depend on pcap, so with either of those running, you will have your card in promiscuous mode.

I notice that noip is set in both boot and default runlevels.  I'm not too familiar with that package, but does it need to be loaded twice?  What happens if you take it out of one of those runlevels?  (I'd recommend trying to take it out of boot first.  noip shouldn't be worried about what the loopback interface says, and only the loopback is brought up on boot.  net.eth0 is brought up on default.)

To test this, try doing this (as root):

In one terminal window, type:

```
 $ tail -f /var/log/messages 
```

This will give you a way to watch what's being written to the logs as it writes it.  Use CTRL+C to stop it when you're done.  Then, in another terminal, try:

```
 $ /etc/init.d/noip stop
```

If that exits cleanly, then try 

```
 $ /etc/init.d/net.eth0 stop
```

and see what happens in the tail of /var/log/messages.  If you get the same messages in the logs as before, then try stopping arpwatch next then try to stop the network interface again.  Did the interface finally stop without complaint?  If so, try starting up the interface again and see what messages it writes to the logs.  If you don't get any errors, then try starting noip and check the messages again.  As I said before, I am unfamiliar with this package other than the fact that it can set a valid DNS record for a system that's connected to the net via a dynamic connection with it's ISP.  That being said, I think noip may depend on arpwatch, and if it does and you shut arpwatch down earlier, the system should complain at this point when you try to start noip.  If so, then start arpwatch and check the tail, then start noip and check the tail again.  What kinds of messages are you getting now?

If everything exited cleanly, though, and started back up without complaint, take the noip out of the boot runlevel. 

```
 $ rc-update del noip boot 
```

Let us know how that goes.

/bk

----------

## HeXiLeD

I tried as you said and got good results.

i removed noip from rc-update at boot and added it only as default

i also removed arpwatch to see how things would be.

conclusion  i started and restarted  the network with and without noip and had no "strange" log messages or errors.

the only thing left  to test was with arpwatch.

I tried to to start arpwatch but  this time  i add some "errors"

```

# /etc/init.d/arpwatch restart

 * Caching service dependencies ...                                                               [ ok ]

 * Starting arpwatch on eth0 ...

touch: cannot touch `/var/lib/arpwatch/eth0.dat': No such file or directory 
```

i never got this before so i dont know exactly what to do now.

The log showed me this message "

```

arpwatch: chdir(/var/lib/arpwatch): No such file or directory

arpwatch: (using current working directory)

eth0: Promiscuous mode enabled.

device eth0 entered promiscuous mode

arpwatch: listening on eth0

arpwatch: fopen(/var/lib/arpwatch/eth0.dat): No such file or directory

device eth0 left promiscuous mode
```

i assume that part of the problem is solved and  identified, but now .. i have this issue with arpwatch

any ideas ?

----------

## HeXiLeD

I just rebooted the box  to see how things went.

arpwatch was removed.

and this was the result :

the rebooted with no problems or errors and  the network was up after reboot.

i was able to ping  yahoo.com for a bit and then :

```

dhcpcd[8268]: timed out waiting for a valid DHCP server response

dhcpcd[8271]: timed out waiting for a valid DHCP server response

dhcpcd[8274]: timed out waiting for a valid DHCP server response

bridge-eth0: disabling the bridge

bridge-eth0: down
```

the problem still remains .....  and i have to restart the network

then i removed  noip from default run level and the issue is not related to it.

after another reboot :

```

 $ ping yahoo.com

PING yahoo.com (216.109.112.135) 56(84) bytes of data.

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=1 ttl=55 time=24.2 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=2 ttl=55 time=23.7 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=3 ttl=55 time=33.1 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=4 ttl=55 time=25.2 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=5 ttl=55 time=25.0 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=6 ttl=55 time=23.3 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=7 ttl=55 time=22.8 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=8 ttl=55 time=27.1 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=9 ttl=55 time=34.9 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=10 ttl=55 time=27.7 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=11 ttl=55 time=24.5 ms

64 bytes from w2.rc.vip.dcn.yahoo.com (216.109.112.135): icmp_seq=12 ttl=55 time=25.0 ms

ping: sendmsg: Network is unreachable

ping: sendmsg: Network is unreachable

ping: sendmsg: Network is unreachable

ping: sendmsg: Network is unreachable

ping: sendmsg: Network is unreachable

```

```

dhcpcd[8274]: timed out waiting for a valid DHCP server response

bridge-eth0: disabling the bridge

bridge-eth0: down
```

----------

## linear

Greetings, and Happy New Year.

Okay... we *do* have network connectivity.  Then it goes out complaining of being unable to get a IP address from a DHCP server.  It shouldn't be worried about that when you've got the connectivity up.

What does your /etc/conf.d/net file have in it?

And what is in your /etc/conf.d/local.start file?

Let us know   :Smile: 

/bk

----------

## HeXiLeD

/etc/conf.d/net

```
# This network configuration was written by net-setup

iface_eth0="192.168.55.141 broadcast 192.168.55.92 netmask 255.255.255.192"

gateway="eth0/192.168.55.39"
```

/etc/conf.d/localstart

```
# This is a good place to load any misc programs

# on startup ( use 1>&2 to hide output)

/etc/init.d/net.eth0 restart
```

i only have this entry in local start because without it i cant get the network back again automaticly.

now that i look at .conf.d/net and  see that the broadcast ip is lower than eth0 ip

i wonder,  if that isnt what is causing the problem ?

all of a sudden  i fell ...  serioulsy lame...  :Confused: 

----------

## linear

Hmmmm...

Well, it seems that from the way that is set up, your Broadcast IP is definitely wrong.

If you are netmasking 255.255.255.192 from 192.168.55.141, your Broadcast should be at 192.168.55.191 and the network should be 192.168.55.128.

Try that setting and see what we get next   :Smile: 

/bk

----------

## HeXiLeD

The issue is now fixed.

With no doubt it was the ip settings on my confs and in my case also my router.

While trying to fix this problem  i also ended up by changing settings in my router to do some testing.

During these settings  i noticed that  the router no matter how many times  was being reset; it keept failing to do what i wanted when i changed manually to other ips.

After 1h of trying to change and testing things, i was able to notice that something was not right with the firmware this time... AGAIN.

Finally i did what i wanted to do a long time ago and a few hard punches on that crappy linksys; (i now have 3 linksys routers), solved the problem and i changed it to another router from my network.

conclusion:

BEFSX41 EtherFast® Cable/DSL Firewall Router with 4-Port Switch/VPN Endpoint = $140 bucks

Wasting days and days reading all the forums out there about this router ( thank you broadband forums for the precious help or i would have killed it a long time ago) = time x money = $bankruptcy

Wasting time testing all available firmwares  for the router; official, beta, unofficial, costum, and even unknown chinese ones = tones of hair loss 

i dont why this time and with this firmware  it refused to do what  i wanted but hey ... 

those 3 hard punches were PRICELESS !

Currently im with an smc router. its works flawlessly with no  ip issues and my box networks confs had no problem at all with just one try. Even when i change some settings and save them, the router doesnt even do a soft reboot bringing my network down for a few seconds.

After re-doing my network i rebooted the box and the network worked perfectly

Thank  you for the attention with this problem  :Smile: 

You have been very helpfull  :Smile: 

----------

