# [Solved] Wireless Spontaneously Combusted (Formerly DHCPCD..

## hlevyn

This error just started when I rebooted. Unfortunately I can't recall the packages I've updated recently that would affect this. Below is the output from when I try to start net.ath0:

```
* Starting ath0

*   Running preup function

ath0                                                                                    [ ok ]

*   Configuring wireless network for ath0

*   Trying to force preferred in case they are hidden

*     ath0 connected to "eclipse_1203" at 00:0F:B5:0B:2F:B0

*     in managed mode on channel 6 (WEP enabled - restricted)

*   You are using a depreciated configuration syntax for ath0

*   You are advised to read /etc/conf.d/net.example and upgrade it accordingly

*   Bringing up ath0

*     dhcp

*       Running dhcpcd ...                                                              [ !! ]
```

The related packages are as follows (I'm using iwconfig rather than wpa_supplicant):

```
[ebuild   R   ] sys-apps/baselayout-1.12.0_pre11-r3  -bootstrap -build -static +unicode 204 kB 

[ebuild   R   ] net-wireless/wireless-tools-28_pre10  -multicall +nls 230 kB 

[ebuild   R   ] net-wireless/madwifi-driver-0.1_pre20051111  3,069 kB
```

And my emerge --info:

```
Gentoo Base System version 1.12.0_pre11

Portage 2.0.53 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r3, 2.6.14-gentoo-r4 i686)

=================================================================

System uname: 2.6.14-gentoo-r4 i686 AMD Athlon(TM) XP 2100+

dev-lang/python:     2.4.2

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1

sys-devel/binutils:  2.16.1-r1

sys-devel/libtool:   1.5.20-r1

virtual/os-headers:  2.6.11-r3

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=athlon-xp -mtune=athlon-xp -O3 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"

CXXFLAGS="-march=athlon-xp -mtune=athlon-xp -O3 -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 X acl alsa apache apache2 apm arts audiofile avi berkdb bitmap-fonts browserplugin bzip2 cdr cdrom crypt cups curl dvd dvdr eds emboss encode esd exif expat fam firefox flac foomaticdb fortran gdbm gif glut gmp gnome gnome-print gpm gstreamer gtk gtk2 hal idn imagemagick imlib ipv6 java jmx jpeg junit lame lcms ldap libg++ libwww mad madwifi mhash mikmod mng motif mozilla mp3 mpeg mpeg2 mpeg4 mplayer ncurses nls nvidia offensive ogg oggvorbis opengl oss pam pcre pdflib perl png ppds python qt quicktime readline samba sdl slang spell sqlite ssl svg svga tcltk tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb vim vorbis win32codecs xine xml xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
```

Does anyone know what might be causing dhcpcd to fail like that? Thanks  :Smile: 

----------

## sethleon

according to the output while booting ... a certain configuration is depreciated ... meaning "in future no longer used",

pls show us / output your /etc/conf.d/net

there seems to be needed an upgrade, maybe that is why dhcpcd is not working correctly

----------

## hlevyn

/etc/conf.d/net:

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

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

iface_eth0="dhcp"

dhcpcd_eth0="-N"

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="eth0/192.168.0.1"

modules=( "iwconfig" )

iface_ath0="dhcp"

dhcpcd_ath0="-N"

key_eclipse_1203="************************** key [1] enc restricted"

preferred_aps=( "eclipse_1203" )

associate_order="forcepreferredonly"

preup() {

  if [ "${IFACE}" = "ath0" ]; then

    /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta

    return $?

  fi

}

postdown() {

  if [ "${IFACE}" = "ath0" ]; then

    /sbin/wlanconfig ath0 destroy

    return $?

  fi

}
```

If I comment out iface_ath0="dhcp" and dhcpcd_ath0="-N", the deprecation warning goes away but it still fails to obtain an IP address.

----------

## sethleon

i found something interesting:

/etc/conf.d/net.example

 *Quote:*   

> # GENERIC WIRELESS OPTIONS
> 
> # PLEASE READ THE INSTRUCTIONS IN /etc/conf.d/wireless.example FOR
> 
> # HOW TO USE THIS ESSID VARIABLE
> ...

 

maybe that could work,

did you try to don't use the option for dhcpcd with flag "-N" ?

----------

## hlevyn

Adding config_eclipse_1203=( "dhcp" ) took care of the warning message, but dhcpcd_eclipse_1203="-t 5" just made it fail faster.  :Sad: 

Anything else I should be looking at here for this? Thanks  :Smile: 

----------

## UberLord

I would guess it's some wireless security that stopping dhcpcd from working.

Does any dhcp client work from the command line?

----------

## hlevyn

That I'm not sure of since I've never had to use dhcp from the command line. How should I go about testing that? What should I enter and what result should I expect? Thanks  :Smile: 

----------

## UberLord

dhcpcd && echo "it works!"

If you don't see "it works!" then it hasn't worked  :Wink: 

----------

## hlevyn

I like nice simple tests like that  :Very Happy: 

Unfortunately though I didn't see "It works"...

----------

## UberLord

99.9% of the time this means

1) the ethernet link is not working.

or

2) the dhcp server isn't working for you.

1) is easy to test - assign yourself a static ip and ping the dhcp server

If that fails then there is an issue with the link - in the case of wireless it's normally the security isn't setup right, the signal is too bad or your drivers Just Don't Work (tm)

2) if you can ping the dhcp server then it's probably a dhcp server issue - check your logs. If your server is not authorative then clear the cache and always try to release the IP.

----------

## hlevyn

Well, even after assigning myself an IP address I still cannot ping anything. The security settings haven't changed since last reboot, so I doubt it would be that. The signal strength seems just fine (I'm on a laptop in the same room as the desktop and signal strength is excellent). So all that's left then is that my drivers Just Don't Work(tm). This one seems odd to me too though since I haven't updated madwifi since November 14th (with the exception of rebuilding for new kernels). Just a random shot in the dark here, but would sys-fs/udev affect this in any way? Simply asking because that's one of the few system packages to have been updated since last reboot.

For it to spontaneously combust like this just boggles my mind. Thanks for your help here in diagnosing it though. Hopefully soon I'll find the root of it (but I certainly wouldn't object if it suddenly fixed itself  :Wink: )

----------

## UberLord

I personally use net-wireless/madwifi-driver-0.1_pre20050420-r1 as the newer ebuilds don't work at all for me. Yeah, it maybe old but it's the most reliable madwifi-driver made so far  :Smile: 

It also means you don't need those nasty preup and postdown functions  :Wink: 

----------

## tutaepaki

Try doing a iwconfig ath0 and check that the interface is set up correctly. Particularly, is  the WEP get actually set !!

I had a problem after upgrading the kernel to 2.6.14 in that the WEP key was no longer being set. If it's not set, set it manually with iwconfig ath0 key <whatever> and then try starting your dhcp again. 

If it works, you've got the same problem. (I switched to WPA to resolve this, as I'd been planning to do that anyway)

----------

## hlevyn

Wow. Good call there! I completely forgot about setting it up manually. So after the preup function in /etc/con.d/net (which is really just executing /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta), the following script gets me up and going:

```
#!/bin/bash

NIC=ath0

SSID=eclipse_1203

KEY=**************************

echo Setting ath0 to mode 3 \(802.11g\)

iwpriv ath0 mode 3

echo Associating with $SSID...

iwconfig $NIC essid $SSID

echo

echo Scanning networks...

iwlist $NIC scan

echo

echo Associating with $SSID...

iwconfig $NIC essid $SSID

echo

echo Setting WEP key...

iwconfig $NIC enc $KEY open

echo

echo Associating with $SSID...

iwconfig $NIC essid $SSID

echo

echo Bringing up $NIC...

ifconfig $NIC up

echo

echo Getting IP via dhcpcd...

dhcpcd $NIC

echo

echo Done.
```

Still a bit puzzled though as to why the other method was failing. But at least it's up and running again. Thanks!  :Very Happy: 

Edit: And on a side note this is post 200. w00t!  :Very Happy: 

----------

## hlevyn

Still not entirely sure what caused it, but I've upgraded the kernel to gentoo-sources-2.6.14-r5, rebuilt madwifi-driver during the upgrade, then rebooted and everything seems to be back to normal. Thanks for all of your help guys.  :Smile: 

----------

