# Wireless and wired stopped working

## ralfsteppacher

Dear all,

after six months I tried to connect my Gentoo laptop to my home network again, but I both wireless and wired do not work anymore. Neither the configuration of my access point/router nor of my laptop have changed since (I ran several Gentoo updates though) and both wired and wirless access used to work. 

If I try to connect on the wireless interface dhcpcd has a time out. The system log shows repeated attempts to get a lease, but they always fail. This keeps going until I stop net.ath0

If I try the wired interface there seems to be some sort of a race condition. The interface receives an IP address, immediatelly afterwards the log says

```
dhcpcd[8299]: eth0 : received SIGTERM, stopping
```

the IP is deleted, the interface stopped, then netplug kicks in and a new IP is obtained, and the interface is stopped again. This happens until I disconnect eth0.

There is several things I do not understand:

- I removed all net.* scripts from the boot configuration with rc-update and still the interfaces are started on boot-up

- For eth0 I see the warning about wireless.conf being deprecated in the system log

- I set channel_ath0="11" in wireless.conf, which is the channel set for the access point, but when I start ath0 it claims to have connected to the access point on channel 6.

My laptop is a Thinkpad T42 with an Atheros wirless chipset.

The same laptop connects just fine, both wireless and wired, when running Windows. 

My last world and system update is about four weeks old, my kernel is 2.6.20-gentoo-r8.

Thanks in advance

Ralf

----------

## erik258

 *Quote:*   

>  I removed all net.* scripts from the boot configuration with rc-update and still the interfaces are started on boot-up 

 

These devices are probably being stared as 'device initiated services' and can be disabled, if you like, in /etc/cond.d/rc, by setting RC_PLUG_SERVICES to something like "!net.*". 

 *Quote:*   

> For eth0 I see the warning about wireless.conf being deprecated in the system log 

 

I highly recommend using wpa_supplicant to deal with your wireless connection.  It supports wpa and can be configured to connect to different wireless networks based on priority.  If you do so, I can send you all my config files (sans security keys, of course) and you can  go from there.  I am not sure why this comes up for eth0, but it shouldn't be there at all anyway.  my guess is there's a type-o in wireless.conf that may be the source of the wierd dhcp behavior too.  

 *Quote:*   

> I set channel_ath0="11" in wireless.conf, which is the channel set for the access point, but when I start ath0 it claims to have connected to the access point on channel 6. 

 

"depreciated" == "don't use".  I highly recommend you take gentoo's warnings to heart.  Again, use an updated wireless management model to tackle this problem.  

If you aren't interested in my configuration method, you should at least migrate away from wireless.conf as I suspect your configurations there aren't being applied.

----------

## mjf55

Hi, I also have a T42 and it works great, so I am sure that we can get you running.

First, what level gentoo do you have ?   --I am running modified genkernel 2.6.22-gentoo-r9.

Next, symlinks are setup for /etc/init.d/net.*?  I have symlinks for net.ath0 and net.eth0 to net.lo

Next, what is in your /etc/conf.d/net.  I have mine setup for wpa_supplicant.

```

# /etc/conf.d/net

# This network configuration was written by mjf

### start of  wpa_supplicant        ###########

modules=( "ifconfig" "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi"

wpa_timeout_ath0=60

config_ath0=( "dhcp")

### end of wpa_supplicant       ############

### configuration for eth0               ############

config_eth0=( "192.168.0.99 netmask 255.255.255.0" )

routes_eth0=( "default gw 192.168.0.1" )

### end of configuration for eth0        ############

```

my wpa_supplicant.conf

```

############# added from Gentoo Documentation Wireless section 4 mjf ####

# The below line not be changed otherwise we refuse to work

ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration

ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection

ap_scan=1

## Shared WEP key connection (no WPA, no IEEE 802.1X)

network={

  ssid="Your_SSID_Here"

  scan_ssid=1

  key_mgmt=NONE

  wep_key0="Your Key Here"

  wep_key1="Your Key Here"

  wep_key2="Your Key Here"

  wep_tx_keyidx=0

  priority=5

}

############ end of Gentoo add  mjf #####################################

############  original #################################################

# This is a network block that connects to any unsecured access point.

# We give it a low priority so any defined blocks are preferred.

network={

   key_mgmt=NONE

   priority=-9999999

}

################# end of original #####################################

```

What dhcp are you using.  I am using dhclient.

I am using madwifi-ng-0.9.3.3

Make sure you have a nameserver in resolv.conf

Well, this is a start.  Let us know what happens

----------

## ralfsteppacher

Hello,

I solved the weird DHCP problem on the eth0 interface through buying a new router today.

I will migrate to wpa_supplicant as you suggest. I saw there is a howto on the Gentoo wiki how to do that. And the configuration example you sent already is very helpful.

One question in advance: The howto says that wpa_supplicant can only connect to SSIDs I configure. Does that mean dynamic look-up and connect of the hot spot in the coffee shop of my choice won't work any more?

I have very limited time at the moment; it might take a couple of days until I can report success or will come back with more questions.

Thanks!

Ralf

----------

## mjf55

Ralf, 

I am glad things are looking up for you.  

If you look in my working example of wpa_supplicant.conf, you will see on the very bottom where you can connect to 'hot spot' networks.  There is no SSID defined.  I have used that while traveling in hotels.

Let us know how you do.

----------

## ralfsteppacher

I made a step forward and two backwards: I installed and configured wpa_supplicant, removed wireless.conf, configured the /etc/conf.d/net script instead, using your configuration as an example. I managed to get the wireless interface to connect to the access point and it received an IP address via DHCP, but as soon as I use the interface from a GDM/gnome session, my machine freezes completely and all I can do is swith it off.

If I have eth0 connected during boot time the machine runs as long as I use eth0. As soon as I unplug eth0 and restart ath0 the machine freezes or ath0 does not receive an IP address and dhcpcd loops again indefinitely trying to get one. I have not had enough time to experiment what exactly causes ath0 not to receive an IP address. It always seems to get one during boot time.

In /var/log/messages I see an error every time I start or stop ath0 with the /etc/init.d/net.ath0 {start,stop} conmmand:

rc-scripts: ERROR: ath0 is already starting up/shutting down

Any idea what could cause the machine to freeze?

Thanks again!

----------

## mjf55

I am not sure why it is not working.  Here are a few thought I have:

I do not have net.ath0 or net.eth0 in my rc-update.  if I do a "rc-update show" , only net.lo is started at boot and netmount at default.  My interfaces ARE started, but not through this mechanism. 

I use the genkernel and have made few modifications to it. ( mainly setting the mach = pentium-m ).  how about you, how custom is your kernel.  There are lots of wireless setting, adapter card settings, that I have altered and caused problems.

In the script "/etc/conf.d/rc" (about line 75) "RC_VERBOSE="no"".  Make it yes.  You get a little more output.

How current is your system.  Kernel version, last time you did a system update, version of madwifi-ng?

Try this:

```
Re-boot system

Log in system.

Open a terminal session

"su -" (log in as root); enter root password

enter "ifconfig" ->post output.

enter "iwconfig" ->post output

enter "rc-update show | grep net*" ->post output

enter "/etc/init.d/net.ath0 status" ->post output

enter "/etc/init.d/net.eth0 status" ->post output

enter "route" ->post output

enter "ping -c 4 google.com" ->post output 

```

So if this is failing, try re-booting to console mode and see if you can use the wireless from there.

Anybody have more thoughts on this?

----------

## ralfsteppacher

OK, the freeze problem I solved through an 'emerge -uD madwifi-ng'.

I also excluded the net.ath* services in the rc script like suggested at the very top of this thread. I added net.lo and net.ath0 to boot, netmount to default. This or running '/etc/init.d/net.ath0 start' manually works now.

BUT, as soon as I run '/etc/init.d/net.ath0 stop' I cannot restart the device anymore, i.e. dhcpcd times out again.

Same when I use wpa_gui. As long as the interface is up I can scan for networks and I can disconnect. But as soon as I do that wpa_client would not reconnect to any network.

I did not modify the preup() and postdown() in '/etc/conf.d/net' (or at least I do not remember doing so):

```

preup() {

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

                /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta

                /sbin/ifconfig ath0 up

                return $?

        fi

}

postdown() {

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

                /sbin/wlanconfig ath0 destroy

        fi

}

```

Thanks!

----------

## mjf55

I do not have any preup() or postdown() code in my /etc/conf.d/net.  In fact, my complete /etc/conf.d/net is listed in my prior post. You may want to comment out the code and try again.

----------

## ralfsteppacher

That worked (I could swear I tried it before, but there you go). I am back to normal.  :Smile:   The wpa_gui works just fine too.

Thanks for hanging in there!

Ralf

----------

## mjf55

Ahhh to be normal.  Welcome back.  I glad you got it working.  Please put [SOLVED] in the subject line.  thanks

----------

## ralfsteppacher

How can I modify the subject of the thread? I cannot see it on the UI.

----------

## mjf55

I just read that you edit the subject line of your FIRST post.

Happy Christmas

----------

