# ifplugd not working with my wifi

## bushwakko

I'm using wpa_supplicant to connect to my networks (wpa at home, wep at my gf)

lapwakko ~ # /etc/init.d/net.eth1 start

 * Starting eth1

 *   Starting wpa_supplicant on eth1 ...                                                                                                            [ ok ]

 *   Starting wpa_cli on eth1 ...                                                                                                                   [ ok ]

 *     eth1 connected to "3Com" at 00:12:A9:CF:A7:2A

 *   eth1 configured with address 192.168.1.225/24

this works very well, however:

lapwakko ~ # /etc/init.d/ifplugd start

 * Starting ifplugd: 

 *   eth0 ...                                                                                                                                       [ ok ]

 *   eth1 ...                                                                                                                                       [ ok ]

iwconfig doesn't even configure correctly wep correctly (with net.eth1 start iwconfig shows the correct wep key in enc)

sometimes I get:

root     12187  0.0  0.0   1500   420 ?        Ss   00:14   0:00 /usr/sbin/ifplugd --iface=eth0 -fIM -t1 -u0 -d0 -mauto

root     12208  0.0  0.0   1504   424 ?        Ss   00:14   0:00 /usr/sbin/ifplugd --iface=eth1 -fIM -t1 -u0 -d0 -mauto

and sometimes this:

root      3849  0.0  0.0   1500   420 ?        Ss   00:02   0:00 /usr/sbin/ifplugd --iface=eth0 -fIM -t1 -u0 -d0 -mauto

root      3873  0.0  0.0   1504   420 ?        Ss   00:02   0:00 /usr/sbin/ifplugd --iface=eth1 -fIM -t1 -u0 -d0 -mauto

root      3875  0.0  0.1   2320  1068 ?        S    00:02   0:00  \_ /bin/sh /etc/ifplugd/ifplugd.action eth1 up

root      3883  0.3  0.1   2848  1716 ?        S    00:02   0:00      \_ /bin/bash /sbin/runscript.sh /etc/init.d/net.eth1 start

root      3921  0.7  0.1   3392  2040 ?        S    00:02   0:00          \_ /bin/bash /sbin/runscript.sh /etc/init.d/net.eth1 start

root      4408  0.0  0.0   1368   408 ?        S    00:03   0:00              \_ /sbin/dhcpcd -h lapwakko -o -m 0 -c /lib/rcscripts/net.modules.d/helpers.

but it doesn't work? if net.eth1 start works, shouldn't ifplug work too?

----------

## UberLord

It looks like you're using baselayout-1.12 - the latest in portage (1.12.0_pre9-r1) has inbuilt ifplugd support, which means you don't need the ifplugd init script.

And no ifplugd does not work with wireless cards. The author claims it does, but I don't think it does really. Feel free to prove me wrong though  :Smile: 

BTW, you're using wpa_supplicant-0.4.x which means that you definitely won't need ifplugd on the wireless interface.

And if you're using wpa_supplicant0-0.4.6, read the below bug.

https://bugs.gentoo.org/show_bug.cgi?id=111053

----------

## bushwakko

I'm running ~x86 so I'm probably using newest baselayout... how does the ifplugging in baselayout work? I just start net.eth1 and eth0 and it will be like running ifplugd?

----------

## UberLord

 *bushwakko wrote:*   

> I'm running ~x86 so I'm probably using newest baselayout... how does the ifplugging in baselayout work? I just start net.eth1 and eth0 and it will be like running ifplugd?

 

Bingo  :Smile: 

All you have todo is install ifplugd or netplug to get the functionality, baselayout-1.12 takes care of everything else (in theory).

----------

## bushwakko

I'll remove ifplugd from the runlevel but I have to have it installed?

what's the difference between ifplugd and netplug then?

----------

## bushwakko

this really sucks:

 * Starting eth0

 *   Starting ifplugd on eth0 ...                                                                                             [ ok ]

 *     Failed to configure eth0 in the background                                                                             [ !! ]

 * Starting eth1

 *   Starting wpa_supplicant on eth1 ...                                                                                      [ ok ]

 *   Starting wpa_cli on eth1 ...                                                                                             [ ok ]

 *     eth1 connected to "3Com" at 00:12:A9:CF:A7:2A

 *   eth1 configured with address 192.168.1.225/24

not only do I get an error in my boot, I also have to wait for both to timeout ! :/ however net.eth1 started correctly, but I still had to wait for it.  :Sad:  eth0 started ifplugd on it, but it waited anyway... sucks

----------

## UberLord

Is a cable plugged in? Even though it's an "error", ifplugd is still monitoring your interface and /etc/init.d/net.eth0 status should report "inactive"

Try setting the timeout to -1 for it to return instantly.

```
plug_timeout_eth0="-1"
```

----------

## bushwakko

no, there is no cable plugged in... but still, shouldn't it just load'em both in the background? instead of waiting on both, if the wifi hadn't connected I'd have to wait for it's timeout too...

----------

## bushwakko

* Caching service dependencies ...                                       [ ok ]

 * Stopping eth0

 *   Bringing down eth0

 *     Shutting down eth0 ...                                             [ ok ]

 *     Stopping ifplugd on eth0 ...                                       [ ok ]

 * Starting eth0

 *   Starting ifplugd on eth0 ...                                         [ ok ]

 *     Failed to configure eth0 in the background                         [ !! ]

still, with that stuff set in conf.d/net, still a timout of about 5 sec or so.

----------

## UberLord

 *bushwakko wrote:*   

> no, there is no cable plugged in... but still, shouldn't it just load'em both in the background? instead of waiting on both, if the wifi hadn't connected I'd have to wait for it's timeout too...

 

Then it's working as it should. If you don't want the long pause you see when booting, try these ideas

1) use a negative timeout - it returns instantly then

2) get hotplug to start net.eth0 for you (ie don't have it in a runlevel)

This involves compiling your NIC driver as a module and using coldplug in the boot runlevel or adding the kernel module to a file in /etc/modules.autoload.d

----------

## UberLord

 *bushwakko wrote:*   

> I'll remove ifplugd from the runlevel but I have to have it installed?

 

yes

 *Quote:*   

> what's the difference between ifplugd and netplug then?

 

netplug is smaller and lighter

ifplugd has more features

Both do the same job though  :Smile: 

----------

## bushwakko

I allready have my NIC as a module and have coldplug in boot. Should this mimic ifplugd? seems to me this might work the first time I put a cable in my nic, but what if I remove it and plug it in again. Also how does coldplug know to start net.eth0 when my nic get's a cable?

As to setting the negative value, I said earlier that I tried setting it on the eth1 card with no luck. Still the timeout...

[EDIT] removing net.eth0 from the startup didn't do anythnig while plugging in the cable.

What I would like was ifplug working as it should  :Razz: 

ifplugd starts stuff in the background, however doesn't seem to start net.eth1 right while in background ... :/

----------

## bushwakko

lapwakko ~ # /etc/init.d/ifplugd start

 * Caching service dependencies ...                                                                                                                 [ ok ]

 * Starting ifplugd: 

 *   eth0 ...                                                                                                                                       [ ok ]

 *   eth1 ...                                                                                                                                       [ ok ]

then:

lapwakko ~ # ifplugstatus 

lo: link beat detected

eth0: unplugged

eth1: link beat detected

which would mean that it should start net.eth1 right?

lapwakko ~ # /etc/init.d/net.eth1 status

 * status:  inactive

what does inactive mean, neither stopped nor started nor starting ? :/

nothing about it in ps afux, only this:

root      1498  0.0  0.0   1500   324 ?        Ss   17:00   0:00 /usr/sbin/ifplugd --iface=eth0 -fIM -t1 -u0 -d0 -mauto

root      1519  0.0  0.0   1500   324 ?        Ss   17:00   0:00 /usr/sbin/ifplugd --iface=eth1 -fIM -t1 -u0 -d0 -mauto

and another time I get status stopped!

Going crazy here! Should be as simple ass, link beat detected, start net.eth1! if not, monitor the linkbeat... I mean, where can this go wrong?

----------

## UberLord

 *bushwakko wrote:*   

> I allready have my NIC as a module and have coldplug in boot. Should this mimic ifplugd?

 

Right - this is what should happen then

coldplug probes - finds the module and starts net.eth0

net.eth0 starts up and fires ifplugd and then "waits"

ifplugd detects cable in and fires net.eth0 again which completes the config

if ifplugd detects cable removed, it does a "net.eth0 stop" but it's now intelligent enough to know not to kill ifplugd or take the interface compeltely down so ifplugd can fire it up again when a cable is re-inserted.

At no point is ifplugd or net.eth0 added to any runlevel

 *Quote:*   

> 
> 
> As to setting the negative value, I said earlier that I tried setting it on the eth1 card with no luck. Still the timeout...
> 
> [EDIT] removing net.eth0 from the startup didn't do anythnig while plugging in the cable.

 

Well, that may be a bug I've already fixed then. I'll be doing a new baselayout release "Soon" (tm)

 *Quote:*   

> What I would like was ifplug working as it should 

 

Well, you are using unstable baselayout - if everything worked as advertised it would be "stable" :p

 *Quote:*   

> ifplugd starts stuff in the background, however doesn't seem to start net.eth1 right while in background ... :/

 

Bah - your eth1 is wireless and ifplugd won't do anything with it!

----------

## bushwakko

Ifpugd won't touch it because it's wireless?

oh well, I'll just wait for the new release then. I can live with the halt in the boot a little while longer.

but as I said, coldplug didn't load net.eth0 at all. nothing at all happened when I inserted my cable..

net.eth0 stopped and not in runlevel.. :/

----------

## UberLord

 *bushwakko wrote:*   

> but as I said, coldplug didn't load net.eth0 at all. nothing at all happened when I inserted my cable..
> 
> net.eth0 stopped and not in runlevel.. :/

 

That could be caused by hotplug blacklisting it - some people do that.

----------

## bushwakko

what does that mean, and how to fix?

----------

