# [Solved] ifplugd doesn't detect wireless card

## jorges

Hi,

I have installed ifplugd o my laptop. It works ok with the LAN card, but detects the wireless card as always being unplugged. I use the intel iwlwifi driver for the iwl3945. As an extra note, together with wlan0 I can see that there is a "wmaster0" in the output of ifconfig that seems related to the wireless card. Anyone have this card working? Any ideas?

jorgesLast edited by jorges on Wed Jan 16, 2008 10:26 am; edited 1 time in total

----------

## UberLord

Use wpa_supplicant for that. ifplugd claims to support wireless, but doesn't. Infact, author recommends wpa_supplicant over ifplugd for wireless.

----------

## jorges

Thanks Uberlord. It works now perfectly with wpa_supplicant for wireless and ifplugd for ethernet. 

jorges

----------

## mimosinnet

 *jorges wrote:*   

> Thanks Uberlord. It works now perfectly with wpa_supplicant for wireless and ifplugd for ethernet.

 

I am having some issues configuring ifplugd. Jorges, how have you configured it? Could you post your /etc/conf.d/net, so I have an example from where I can work?

Thanks!

----------

## jorges

 *mimosinnet wrote:*   

> 
> 
> I am having some issues configuring ifplugd. Jorges, how have you configured it? Could you post your /etc/conf.d/net, so I have an example from where I can work?
> 
> Thanks!

 

Here it goes:

```
# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

metric_eth0="10"

metric_wlan0="20"

# LAN

plug_timeout="10"

config_eth0=("192.168.1.129 netmask 255.255.255.0 brd 192.168.1.255")

routes_eth0=("default via 192.168.1.1")

dns_servers_eth0=("192.168.1.1")

# Wireless

# Prevent ifplugd from managing wlan0

modules_wlan0=( "!plug" )

# Necessary for  my bcm4318 card

iwconfig_wlan0=( "txpower on" )

# Prefer wpa_supplicant over wireless tools

modules_wlan0=( "wpa_supplicant" )

# Tell wpa_supplicant which driver to use

wpa_supplicant_wlan0="-Dwext"

# How long to wait for association

associate_timeout_wlan0="15"

config_littlehomenetwork=("192.168.1.128/24")

routes_littlehomenetwork=("default via 192.168.1.1")

dns_servers_littlehomenetwork=("192.168.1.1")

config_IRIWL=("dhcp")

config_Matias=("dhcp")
```

----------

## mimosinnet

Thanks very much jorges. I have been unsuccessful with setting up ifplugd. When I start the computer without the lan cable, I get the following interfaces:

```
# ifconfig

ath0      Link encap:Ethernet  HWaddr 00:16:44:1B:18:83

          inet addr:169.254.13.51  Bcast:169.254.255.255  Mask:255.255.0.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth0      Link encap:Ethernet  HWaddr 00:A0:D1:CB:64:4E

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:22 Base address:0xdead

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:312 errors:0 dropped:0 overruns:0 frame:0

          TX packets:312 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:17799 (17.3 Kb)  TX bytes:17799 (17.3 Kb)

wifi0     Link encap:UNSPEC  HWaddr 00-16-44-1B-18-83-20-2E-00-00-00-00-00-00-00-00

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:40 errors:0 dropped:0 overruns:0 frame:3

          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:3955 (3.8 Kb)  TX bytes:1830 (1.7 Kb)

          Interrupt:16
```

This message appears persistently in my /var/log/messages

```
Mar 19 11:08:59 joanet eth0: PHY reset until link up.
```

I stop my eth0 interface to get rid of the messages:

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

This sequences of commands get a correct IP to ath0:

```
# ifconfig ath0 down

# ifconfig ath0 up

# dhcpcd ath0

Error, ath0: dhcpcd already running on pid 4417 (/var/run/dhcpcd-ath0.pid)

# rm /var/run/dhcpcd-ath0.pid

# dhcpcd ath0

# cat /etc/conf.d/net
```

I have tried the same without ifconfig down/up and dhcpcd does not get the ip. In my /etc/conf.d/net I use arping to be able to get conditional IP's depending on the network (this is a laptop), and I imagine this may be the reason I get incorrect IP's in my intefaces. I have been trying to adapt your parameters in my  /etc/conf.d/net, but ifplugd does not seem to be working. This is my /etc/conf.d/net, any hints appreciated:

```
# cat /etc/conf.d/net

hotplug_eth0="yes"

#http://gentoo-wiki.com/HARDWARE_Intel_G33,_Q35,_and_Q33_Chipsets#Network_Settings

ifplugd_eth0="--poll-time=15"

modules_eth0=( "ifplugd" )

config_eth0=( "arping" )

# En cas de que el gateway sigui 192.168.1.1 (casa) li donem 192.168.1.105

gateways_eth0="192.168.1.1,00:14:BF:86:F0:FB"

config_192168001001_0014BF86F0FB=( "192.168.1.105/24" )

routes_192168001001_0014BF86F0FB=( "default via 192.168.1.1" )

# En cas contrari, dhcp

fallback_eth0=( "dhcp" )

# ath0

modules_ath0=( "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_ath0=60

# Prevent ifplugd from managing ath0 (prova)

modules_ath0=( "!plug" )

# Enable arping mode

config_ath0=( "arping" )

# Define the gateways you want to configure

# You can consider each gateway as a profile

gateways_ath0="192.168.1.1,00:14:BF:86:F0:FB"

# Define the IP and netmask,default route and DNS server when using gateway 192.168.1.1

# Quan esta a casa li donem la IP 192.168.1.106

config_192168001001_0014BF86F0FB=( "192.168.1.106 netmask 255.255.255.0" )

routes_192168001001_0014BF86F0FB=( "default via 192.168.1.1" )

# dns_servers_192168001001=( "192.168.1.1" )

# If any of the above profiles fail use DHCP

fallback_ath0=( "dhcp" )

iwconfig_ath0="mode managed"
```

----------

## mimosinnet

I have unset the arping options, and the result is similar:

```
$ cat /etc/conf.d/net

hotplug_eth0="yes"

ifplugd_eth0="--poll-time=15"

modules_eth0=( "ifplugd" )

fallback_eth0=( "dhcp" )

# ath0

modules_ath0=( "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_ath0=60

modules_ath0=( "!plug" )

fallback_ath0=( "dhcp" )

iwconfig_ath0="mode managed"
```

This is what I get and what I need to do to get my ath0:

```
# ifconfig

ath0      Link encap:Ethernet  HWaddr 00:16:44:1B:18:83

          inet addr:169.254.14.226  Bcast:169.254.255.255  Mask:255.255.0.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth0      Link encap:Ethernet  HWaddr 00:A0:D1:CB:64:4E

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:22 Base address:0xdead

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:200 errors:0 dropped:0 overruns:0 frame:0

          TX packets:200 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:11445 (11.1 Kb)  TX bytes:11445 (11.1 Kb)

wifi0     Link encap:UNSPEC  HWaddr 00-16-44-1B-18-83-00-84-00-00-00-00-00-00-00-00

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:32 errors:0 dropped:0 overruns:0 frame:6

          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:3060 (2.9 Kb)  TX bytes:1830 (1.7 Kb)

          Interrupt:16

joanet joanet # dhcpcd ath0

Error, ath0: dhcpcd already running on pid 4398 (/var/run/dhcpcd-ath0.pid)

joanet joanet # rm /var/run/dhcpcd-ath0.pid

joanet joanet # dhcpcd ath0

Error, ath0: timed out

joanet joanet # ifconfig ath0 down

joanet joanet # ifconfig ath0 up

joanet joanet # dhcpcd ath0

Error, ath0: dhcpcd already running on pid 7408 (/var/run/dhcpcd-ath0.pid)

joanet joanet # rm /var/run/dhcpcd-ath0.pid

joanet joanet # dhcpcd ath0
```

This instructions give me the right address. Any suggestions welcomed. Thanks!

----------

## jorges

 *mimosinnet wrote:*   

> 
> 
> joanet joanet # dhcpcd ath0
> 
> Error, ath0: dhcpcd already running on pid 4398 (/var/run/dhcpcd-ath0.pid)
> ...

 

I am not an expert at all here, but if your problem is that your interface needs to be "upped" before it can be configured, you might be able to tell ifconfig to do so when starting the network. I do something along the lines for the wireless on my laptop at home which for some reason gets started with txpower off. In this case adding 

```
ifconfig_wlan0 = ( "txpower on")
```

 to /etc/conf.d/net did the trick.

Sorry if this doesn't help, but as I said before, I am just a plain user that got this working by reading and getting some help from others.

jorges

----------

## mimosinnet

Thanks a lot jorges. That did not do the trick, and I will keep searching. Your configuration file has been very useful at building my own.   :Very Happy: 

Cheers!

----------

