You are not logged in.

#1 2015-04-01 15:07:23

bygmhra
Member
Registered: 2011-12-22
Posts: 25

[solved] difficulty acquiring dhcp lease for wireless

I have a USB wireless adapter (Edimax EW-7811Un).

Its interface name is wlp0s20u2.

Attempting to connect manually, there is no trouble associating with the AP.

# wpa_supplicant -B -i wlp0s20u2 -c /etc/wpa_supplicant/eduroam.conf

$ iwconfig
wlp0s20u2  IEEE 802.11bgn  ESSID:"eduroam"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:3A:98:C0:C8:32   
          Bit Rate=6 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Power Management:off
          Link Quality=53/70  Signal level=-57 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:5   Missed beacon:0

However both dhclient and dhcpcd (versions 6.8.1 and 6.8.0) have been unable to obtain a lease.

# dhcpcd wlp0s20u2 -d
dhcpcd-6.8.1 starting
wlp0s20u2: disabling kernel IPv6 RA support
wlp0s20u2: executing `usr/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
wlp0s20u2: executing `usr/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
wlp0s20u2: waiting for carrier
timed out
dhcpcd exited


# dhclient wlp0s20u2 -d
Internet Systems Consortium DHCP Client 4.3.2
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlp0s20u2/80:1f:02:e6:85:e8
Sending on   LPF/wlp0s20u2/80:1f:02:e6:85:e8
Sending on   Socket/fallback
DHCPDISCOVER on wlp0s20u2 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlp0s20u2 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlp0s20u2 to 255.255.255.255 port 67 interval 17
DHCPDISCOVER on wlp0s20u2 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on wlp0s20u2 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlp0s20u2 to 255.255.255.255 port 67 interval 4
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

I was able to get a lease when connecting to an unencrypted network (using dhclient; did not try dhcpcd).

I also was able to get a lease once while using dhcpcd version 6.8.0.
At that time I ran

# dhcpcd --ipv4only wlp0s20u2

But I have not been able to reproduce this.

I have tried

# iw dev wlp0s20u2 set power_save off
# iwconfig wlp0s20u2 channel auto

as the wiki suggests to no success.

edit
I was looking at the output of journalctl -f when the following popped up

systemd-networkd[316]: wlp0s20u2    : gained carrier

So immediately I tried

#dhcpcd wlp0s20u2 -d
dhcpcd-6.8.1 starting
wlp0s20u2: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
wlp0s20u2: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
DUID 00:01:00:01:1b:ad:1d:68:18:cf:5e:bd:6d:c3
wlp0s20u2: IAID 02:e6:85:e8
wlp0s20u2: delaying IPv6 router solicitation for 0.6 seconds
wlp0s20u2: delaying IPv4 for0.6 seconds
wlp0s20u2: soliciting an IPv6 router
wlp0s20u2: sending Router Solicitation
wlp0s20u2: soliciting a DHCP lease
wlp0s20u2: sending DISCOVER (xid 0xc9c4152c), next in 4.6 seconds
wlp0s20u2: sending Router Solicitation
wlp0s20u2: sending DISCOVER (xid 0xc9c4152c), next in 7.1 seconds
wlp0s20u2: sending Router Solicitation
wlp0s20u2: no IPv6 Routers available
wlp0s20u2: sending DISCOVER (xid 0xc9c4152c), next in 32.9 seconds
wlp0s20u2: carrier lost
wlp0s20u2: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
wlp0s20u2: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks' EXPIRE
timed out
dhcpcd exited

Since it said no IPv6 Routers available, I thought I'd try with the -4 flag. But it was unsuccessful. However when I saw the systemd-netword gained carrier line again, and then tried to solicit a lease it was successful.

Problem is it takes ages for the carrier to be gained in the first place. Any ideas why?

Last edited by bygmhra (2015-04-10 13:10:10)

Offline

#2 2015-04-01 19:40:06

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,795
Website

Re: [solved] difficulty acquiring dhcp lease for wireless

You could try disabling the IPV6 stack using this kernel parameter:

ipv6.disable=1

Can you connect using a static IP?

# ip addr add <address>/<netmask> broadcast <broadcast> dev wlp0s20u2
# ip route add default via <gateway>

https://wiki.archlinux.org/index.php/Ne … IP_address

Did you set the rts threshold to maximum yourself?

Have you tried setting it to zero?

# iwconfig wlp0s20u2 rts 0

Jin, Jîyan, Azadî

Offline

#3 2015-04-04 01:15:39

bygmhra
Member
Registered: 2011-12-22
Posts: 25

Re: [solved] difficulty acquiring dhcp lease for wireless

Hi Head_on_a_Stick, thanks for your response! I don't know enough about static IPs to know which address/broadcast/gateway values to use, so I have not tried connecting using a static IP.

Did you set the rts threshold to maximum yourself?

Have you tried setting it to zero?

No I did not set that. I tried setting it to zero but it made no difference.

-----

In other news, I went to the library and tried to connect (to the same wireless network) and was able to. However upon returning to my dorm room, I still was unable to connect.

I thought I would try upgrading the driver (rtl8192cu). I wasn't even able to build the manufacturer's driver (version 4.0.2_9000), but I found this repo, which successfully installed.

(For posterity: I did need to specify the wext driver when connecting with wpa_supplicant.)

So I think things are working (fingers crossed!) and will close this in a few days if that's really the case.

Offline

Board footer

Powered by FluxBB