# PBM: ifplugd doesn't up eth0 when plugging back the cable

## VinzC

Hi.

I'm using suspend2-sources-2.6.12_rc5 (vanilla-based), baselayout-1.11.12-r4 and ifplugd-0.28. When I boot my laptop while the network cable is plugged, ifplugd brings up my built-in NIC (eth0), which gets its IP address from DHCP. If I unplug the network cable eth0 goes down as expected - I can even hear ifplugd so the beep. But if I plug the cable back, the network script, net.eth0, is not run and there is no beep. I have to manually restart /etc/init.d/net.eth0: restarting /etc/init.d/ifplugd doesn't help.

Does anyone have an idea?

EDIT: here's ifplugd configuration file

```
INTERFACES="eth0"

AUTO="no"

BEEP="yes"

IGNORE_FAIL="yes"

IGNORE_FAIL_POSITIVE="no"

IGNORE_RETVAL="yes"

POLL_TIME="1"

DELAY_UP="0"

DELAY_DOWN="0"

API_MODE="auto"

SHUTDOWN="no"

WAIT_ON_FORK="no"

MONITOR="yes"

ARGS=""
```

Thanks.

----------

## bonbons

Kind of the same problem I experience here... and don't know why! dmesg reports correct status changes for the card in all cases.

What network card do you have (looks like wether the card is "up" or not has some influence as ifplugstatus does not display the right information if the card is no "up")

I'm running an Acer TM66x with Broadcom 10/100 Card, B44 driver

----------

## VinzC

 *bonbons wrote:*   

> ... Broadcom 10/100 Card, B44 driver

 

Same here.

----------

## bonbons

 *VinzC wrote:*   

>  *bonbons wrote:*   ... Broadcom 10/100 Card, B44 driver 
> 
> Same here.

 Somehow out of topic, but eventually very useful...

Is your LAN connection 100% stable, or does it sometimes break (e.g. stops receiving but continues sending) or getting very slow for data transfer but high activity seen on Switch (happens for me on DLink switch DES 1005D), I'm wondering if the switch is getting old (some of my realtec cards work fine on the same port of the switch but some other cards have troubles as well)

----------

## VinzC

 *bonbons wrote:*   

> Is your LAN connection 100% stable, or does it sometimes break (e.g. stops receiving but continues sending) or getting very slow for data transfer but high activity seen on Switch (happens for me on DLink switch DES 1005D), I'm wondering if the switch is getting old (some of my realtec cards work fine on the same port of the switch but some other cards have troubles as well)

 

Well, I don't know. I think it's rather stable as we have taken care of our company network. At home I don't use a cable, only WiFi. At least I never experienced network drops like you're describing.

----------

## nyda

Same problem here with B44.

I noticed the B44 leaves a message in the system log each time the cable is plugged in or out - as long as net.eth0 is running. If I stop it (or ifplugd stops it), b44 no longer reports the plug-in event. I guess thats the reason why it ifplugd doesn't recognize when the cable is plugged in again.

I also noticed another issue: When I try to bring up eth0 manually with /etc/init.d/net.eth0 start, the script will time out on dhcp. The syslog says that dhcp temporarily brings down the interface and up again. Since ifplugd monitors theses events, both scripts get caught in a loop until the timout expires.

Basically I just want my laptop to bring the interface up when a cable is connected. Seems simple. Is hard. On Linux.

----------

## VinzC

I'm wondering: does it happen only when on batteries? I know Windows brings and keeps the adapter down as soon as you unplug the cable when the laptop runs on batteries. If the laptop doesn't run on batteries but on mains, Windows brings the card down and up everytime you unplug and plug the cable. I'm going to make some tests. We'll see.

EDIT: no. doesn't work  :Sad: ... I've tested module bcm4400-3.0.13 (from portage) and b44 (built-in). No way with both. Is it the driver or the hardware that is crap?   :Evil or Very Mad: 

----------

## UberLord

The issue is that when ifplugd says "go down", net.eth0 brings the interface completly down which stops ifplugd from working with some cards.

This is fixed in baselayout-1.12.0_pre9-r1 as we've integreated ifplugd with baselayout so no need for an init script.

----------

## VinzC

 *UberLord wrote:*   

> The issue is that when ifplugd says "go down", net.eth0 brings the interface completly down which stops ifplugd from working with some cards.
> 
> This is fixed in baselayout-1.12.0_pre9-r1 as we've integreated ifplugd with baselayout so no need for an init script.

 

Thanks. Going to try it now...

----------

## UberLord

Just be aware of issues in the below thread

https://forums.gentoo.org/viewtopic-t-397593-highlight-ifplugd.html

----------

## VinzC

 *UberLord wrote:*   

> Just be aware of issues in the below thread
> 
> https://forums.gentoo.org/viewtopic-t-397593-highlight-ifplugd.html

 

Fair enough. I'll wait till _pre10 comes out too.

If I've understood, with baselayout 1.12.xxx /etc/init.d/ifplugd is not needed anymore and is present as a module in the network configuration file; the package may then be safely unmerged, is that correct? Or do I still need it?

----------

## UberLord

 *VinzC wrote:*   

>  *UberLord wrote:*   Just be aware of issues in the below thread
> 
> https://forums.gentoo.org/viewtopic-t-397593-highlight-ifplugd.html 
> 
> Fair enough. I'll wait till _pre10 comes out too.
> ...

 

No, you still need ifplugd emerged. ifplugd will provide an init script until baselayout-1.12 goes stable  :Smile: 

 It's safer to use ~ARCH ifplugd as that has a new init script that does not conflict with the one included in baselayout-1.12.0_pre9 and upwards.

----------

## VinzC

 *UberLord wrote:*   

> ...
> 
> It's safer to use ~ARCH ifplugd as that has a new init script that does not conflict with the one included in baselayout-1.12.0_pre9 and upwards.

 

Done. Thanks again.

----------

## VinzC

In fact this is even worse and the wired network doesn't start at boot. I think I'll try netplug instead. Moreover I'm also using ipw2200, which causes me nothing but troubles since I upgraded to version 1.0.6. The module stops working for reasons I can't figure out. It produces lots of error messages (failed to send ASSOCIATE command). But it's off topic here.

----------

