# wpa_supplicant, dhcp, dhcpcd, and ipv4

## CrankyPenguin

I have an Intel IWL4965 wireless card which, until recent kernels, worked fine with a range of networks.  At home, and on newer (ipv6) routers the card works fine configured through wpa_supplicant.  However when I attempt to connect to wireless networks on older routers or those that cannot handle ipv6 requests I get errors.  On occasion the card will connect, report the absence of ipv6 routers and obtain an ipv4 address.  It will shortly thereafter drop the address and default to a 169 address.  

The relevant dmesg lines are:

```
wlan0: RX AssocResp from 55:4e:7f:8e:54:ee (capab=0x421 status=0 aid=4)

wlan0: associated

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan0: no IPv6 routers present

wlan0: deauthenticating from 55:4e:7f:8e:54:ee by local choice (reason=3)

cfg80211: Calling CRDA to update world regulatory domain

ADDRCONF(NETDEV_UP): wlan0: link is not ready

```

I can configure the card for some networks using dhclient and the iwconfig commands in /etc/conf.d/net as shown below:

```
modules=( "iwconfig" )

modules_wlan0=( "dhclient" )

essid_wlan0=( "MCL" )

config_MCL=( dhclient )

```

This connection is stable and persistent.  Thus the issue appears to be a problem with the standard dhcp.  

This leaves me with the following questions:

Can I configure wpa_supplicant to use dhclient?  If so how?

If I can do so can I set it to be network-specific.  I would like to use ipv6 where possible?

Or if not is there a way to fix the existing dhcpcd to work with ipv4?

Thanks!

----------

## UberLord

 *CrankyPenguin wrote:*   

> This connection is stable and persistent.  Thus the issue appears to be a problem with the standard dhcp.  

 

I disgaree.

dhcpcd obeys the kernel reported carrier status whereas dhclient does not. dhcpcd is just responding correctly to the kernel saying "carrier down" and when it comes back up again the signal is too weak to get the last address or something. If you dislike that behavior you can disable it in dhcpcd.conf(5)

----------

## CrankyPenguin

Thanks UberLord I'll look into the config changes but I think it may be more than that.  You see once the carrier is down it cannot reconnect yet the signal strength is in fact good.  I have noticed that the problem only occurrs in places with older wifi setups, even small ones with high connections.  And once down I cannot get the system to issue a new IP.  As such I think it has to be more than just weak signal.

----------

## UberLord

Even if you're correct, it's not a dhcpcd problem as I see it  :Smile: 

----------

## CrankyPenguin

Fair point UberLord.  The issue with dhcpcd as I see it is that I can't seem to get it to work with older routers that are, I suspect, capable of only IPv4.  I've still got that in my kernel and in my use flags but I can't figure out how to get it to do so.  I'll see if your solution makes a difference the next time I encounter one.  Thanks.

----------

