LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Problems with wpa_supplicant and rc.inet1 on Slackware x86_64 -current (https://www.linuxquestions.org/questions/slackware-14/problems-with-wpa_supplicant-and-rc-inet1-on-slackware-x86_64-current-4175692427/)

pakcjo 03-21-2021 09:57 PM

Problems with wpa_supplicant and rc.inet1 on Slackware x86_64 -current
 
Hello,

After the last upgrade to -current I noticed that rc.inet1 fails to start my wireless network. My configuration for rc.inet1.conf is:

Code:

IFNAME[4]="wlan1"
USE_DHCP[4]="yes"
WLAN_WPA[4]="wpa_supplicant"
WLAN_WPADRIVER[4]="nl80211"
WLAN_WPAWAIT[4]=120

When rc.inet1 is called with start, I get:

Code:

Starting the network interfaces...
Successfully initialized wpa_supplicant
wlan1: polling for DHCP server
wlan1: waiting for carrier
wlan1: carrier acquired
wlan1: connected to Access Point `MyNetworkAP'
DUID 00:04:35:30:45:35:34:39:33:35:32:30:42:43:ff:ff:ff:ff
wlan1: IAID d5:fd:dc:b6
wlan1: soliciting a DHCP lease
wlan1: offered 192.168.1.185 from 192.168.1.1
wlan1: probing address 192.168.1.185/24
timed out
dhcpcd exited

The /var/log/messages says:

Code:

Mar 21 21:33:07 darkstar rc.inet1[14024]: wlan1: configuring interface
Mar 21 21:33:11 darkstar root: /etc/rc.d/rc.inet1:  wpa_supplicant -B -c/etc/wpa_supplicant.conf -Dnl80211 -iwlan1
Mar 21 21:33:19 darkstar kernel: wlan1: authenticate with 1c:3b:f3:86:be:99
Mar 21 21:33:19 darkstar kernel: wlan1: send auth to 1c:3b:f3:86:be:99 (try 1/3)
Mar 21 21:33:19 darkstar kernel: wlan1: authenticated
Mar 21 21:33:19 darkstar kernel: wlan1: associate with 1c:3b:f3:86:be:99 (try 1/3)
Mar 21 21:33:19 darkstar kernel: wlan1: associate with 1c:3b:f3:86:be:99 (try 2/3)
Mar 21 21:33:19 darkstar kernel: wlan1: RX AssocResp from 1c:3b:f3:86:be:99 (capab=0x411 status=0 aid=2)
Mar 21 21:33:19 darkstar kernel: wlan1: associated
Mar 21 21:33:19 darkstar kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Mar 21 21:33:19 darkstar kernel: wlan1: deauthenticating from 1c:3b:f3:86:be:99 by local choice (Reason: 3=DEAUTH_LEAVING)
Mar 21 21:33:24 darkstar rc.inet1[14024]: wlan1: starting dhcpcd
Mar 21 21:33:24 darkstar dhcpcd[14191]: wlan1: waiting for carrier
Mar 21 21:33:31 darkstar kernel: wlan1: authenticate with 1c:3b:f3:86:b1:01
Mar 21 21:33:32 darkstar kernel: wlan1: send auth to 1c:3b:f3:86:b1:01 (try 1/3)
Mar 21 21:33:32 darkstar kernel: wlan1: authenticated
Mar 21 21:33:32 darkstar kernel: wlan1: associate with 1c:3b:f3:86:b1:01 (try 1/3)
Mar 21 21:33:32 darkstar kernel: wlan1: associate with 1c:3b:f3:86:b1:01 (try 2/3)
Mar 21 21:33:32 darkstar kernel: wlan1: RX AssocResp from 1c:3b:f3:86:b1:01 (capab=0x411 status=0 aid=3)
Mar 21 21:33:32 darkstar kernel: wlan1: associated
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: carrier acquired
Mar 21 21:33:32 darkstar kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: connected to Access Point `MyNetworkAP'
Mar 21 21:33:32 darkstar dhcpcd[14191]: DUID 00:04:35:30:45:35:34:39:33:35:32:30:42:43:ff:ff:ff:ff
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: IAID d5:fd:dc:b6
Mar 21 21:33:33 darkstar dhcpcd[14191]: wlan1: soliciting a DHCP lease
Mar 21 21:33:37 darkstar dhcpcd[14191]: wlan1: offered 192.168.1.185 from 192.168.1.1
Mar 21 21:33:37 darkstar dhcpcd[14191]: wlan1: probing address 192.168.1.185/24
Mar 21 21:33:39 darkstar dhcpcd[14191]: dhcpcd exited
Mar 21 21:33:39 darkstar rc.inet1[14024]: wlan1: failed to obtain DHCP lease
Mar 21 21:33:38 darkstar kernel: wlan1: deauthenticating from 1c:3b:f3:86:b1:01 by local choice (Reason: 3=DEAUTH_LEAVING)

The odd part is that if I just open a terminal and call wpa_supplicant with the exact command as rc.inet1 uses and then call dhclient wlan1 or dhcpcd everything just works...

I'd appreciate any suggestion about this.

Thanks!

USUARIONUEVO 03-21-2021 10:17 PM

after slackpkg upgrade you do

slackpkg new-config ?

kaott 03-21-2021 10:19 PM

How are you running dhcpcd or dhclient? Are you giving them a timeout option? From what you posted it looks like it is timing out when trying to get a dhcp lease.

I don't think this changed with the update, and the default should be 15 seconds, but maybe it needs more time.

I think the default timeout interval for dhcpcd is 30 seconds, and 60 seconds for dhclient.

If this doesn't work try setting:
DHCP_DEBUG[4]="yes"
and maybe
DEBUG_ETH_UP="yes"
to see if that helps give more information.

colorpurple21859 03-21-2021 10:35 PM

did your /etc/wpa_supplicant.conf get overwritten?

Mechanikx 03-22-2021 01:14 AM

Quote:

Originally Posted by pakcjo (Post 6232847)
Hello,

After the last upgrade to -current I noticed that rc.inet1 fails to start my wireless network. My configuration for rc.inet1.conf is:

Code:

IFNAME[4]="wlan1"
USE_DHCP[4]="yes"
WLAN_WPA[4]="wpa_supplicant"
WLAN_WPADRIVER[4]="nl80211"
WLAN_WPAWAIT[4]=120

When rc.inet1 is called with start, I get:

Code:

Starting the network interfaces...
Successfully initialized wpa_supplicant
wlan1: polling for DHCP server
wlan1: waiting for carrier
wlan1: carrier acquired
wlan1: connected to Access Point `MyNetworkAP'
DUID 00:04:35:30:45:35:34:39:33:35:32:30:42:43:ff:ff:ff:ff
wlan1: IAID d5:fd:dc:b6
wlan1: soliciting a DHCP lease
wlan1: offered 192.168.1.185 from 192.168.1.1
wlan1: probing address 192.168.1.185/24
timed out
dhcpcd exited

The /var/log/messages says:

Code:

Mar 21 21:33:07 darkstar rc.inet1[14024]: wlan1: configuring interface
Mar 21 21:33:11 darkstar root: /etc/rc.d/rc.inet1:  wpa_supplicant -B -c/etc/wpa_supplicant.conf -Dnl80211 -iwlan1
Mar 21 21:33:19 darkstar kernel: wlan1: authenticate with 1c:3b:f3:86:be:99
Mar 21 21:33:19 darkstar kernel: wlan1: send auth to 1c:3b:f3:86:be:99 (try 1/3)
Mar 21 21:33:19 darkstar kernel: wlan1: authenticated
Mar 21 21:33:19 darkstar kernel: wlan1: associate with 1c:3b:f3:86:be:99 (try 1/3)
Mar 21 21:33:19 darkstar kernel: wlan1: associate with 1c:3b:f3:86:be:99 (try 2/3)
Mar 21 21:33:19 darkstar kernel: wlan1: RX AssocResp from 1c:3b:f3:86:be:99 (capab=0x411 status=0 aid=2)
Mar 21 21:33:19 darkstar kernel: wlan1: associated
Mar 21 21:33:19 darkstar kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Mar 21 21:33:19 darkstar kernel: wlan1: deauthenticating from 1c:3b:f3:86:be:99 by local choice (Reason: 3=DEAUTH_LEAVING)
Mar 21 21:33:24 darkstar rc.inet1[14024]: wlan1: starting dhcpcd
Mar 21 21:33:24 darkstar dhcpcd[14191]: wlan1: waiting for carrier
Mar 21 21:33:31 darkstar kernel: wlan1: authenticate with 1c:3b:f3:86:b1:01
Mar 21 21:33:32 darkstar kernel: wlan1: send auth to 1c:3b:f3:86:b1:01 (try 1/3)
Mar 21 21:33:32 darkstar kernel: wlan1: authenticated
Mar 21 21:33:32 darkstar kernel: wlan1: associate with 1c:3b:f3:86:b1:01 (try 1/3)
Mar 21 21:33:32 darkstar kernel: wlan1: associate with 1c:3b:f3:86:b1:01 (try 2/3)
Mar 21 21:33:32 darkstar kernel: wlan1: RX AssocResp from 1c:3b:f3:86:b1:01 (capab=0x411 status=0 aid=3)
Mar 21 21:33:32 darkstar kernel: wlan1: associated
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: carrier acquired
Mar 21 21:33:32 darkstar kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: connected to Access Point `MyNetworkAP'
Mar 21 21:33:32 darkstar dhcpcd[14191]: DUID 00:04:35:30:45:35:34:39:33:35:32:30:42:43:ff:ff:ff:ff
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: IAID d5:fd:dc:b6
Mar 21 21:33:33 darkstar dhcpcd[14191]: wlan1: soliciting a DHCP lease
Mar 21 21:33:37 darkstar dhcpcd[14191]: wlan1: offered 192.168.1.185 from 192.168.1.1
Mar 21 21:33:37 darkstar dhcpcd[14191]: wlan1: probing address 192.168.1.185/24
Mar 21 21:33:39 darkstar dhcpcd[14191]: dhcpcd exited
Mar 21 21:33:39 darkstar rc.inet1[14024]: wlan1: failed to obtain DHCP lease
Mar 21 21:33:38 darkstar kernel: wlan1: deauthenticating from 1c:3b:f3:86:b1:01 by local choice (Reason: 3=DEAUTH_LEAVING)

The odd part is that if I just open a terminal and call wpa_supplicant with the exact command as rc.inet1 uses and then call dhclient wlan1 or dhcpcd everything just works...

I'd appreciate any suggestion about this.

Thanks!

I had the same problem after the update that modified rc.inet1.conf. I checked the diff between the old and the new rc.inet1.conf and ensured it didn't remove any of my settings which it didn't. Not long after that update I lost my connection. So I ran

Code:

/etc/rc.d/rc.inet1 wlan0_restart
and it timed out. I double checked rc.inet1.conf and also checked wpa_supplicant.conf and none of my settings had been overwritten. So I ran it again and this time it worked. I rebooted just to make sure it would stick which it did and it's been fine ever since.

tadgy 03-22-2021 05:44 AM

Quote:

Originally Posted by pakcjo (Post 6232847)
Hello,

After the last upgrade to -current I noticed that rc.inet1 fails to start my wireless network. My configuration for rc.inet1.conf is:

Code:

IFNAME[4]="wlan1"
USE_DHCP[4]="yes"
WLAN_WPA[4]="wpa_supplicant"
WLAN_WPADRIVER[4]="nl80211"
WLAN_WPAWAIT[4]=120


This seems fine; though, as suggested by others, you could try increasing the DHCP timeout, for example:
Code:

DHCP_TIMEOUT[4]="120"
Quote:

Originally Posted by pakcjo (Post 6232847)
Code:

<snip>
wlan1: probing address 192.168.1.185/24
timed out
dhcpcd exited


and

Quote:

Originally Posted by pakcjo (Post 6232847)
Code:

<snip>
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: connected to Access Point `MyNetworkAP'
Mar 21 21:33:32 darkstar dhcpcd[14191]: DUID 00:04:35:30:45:35:34:39:33:35:32:30:42:43:ff:ff:ff:ff
Mar 21 21:33:32 darkstar dhcpcd[14191]: wlan1: IAID d5:fd:dc:b6
Mar 21 21:33:33 darkstar dhcpcd[14191]: wlan1: soliciting a DHCP lease
Mar 21 21:33:37 darkstar dhcpcd[14191]: wlan1: offered 192.168.1.185 from 192.168.1.1
Mar 21 21:33:37 darkstar dhcpcd[14191]: wlan1: probing address 192.168.1.185/24
Mar 21 21:33:39 darkstar dhcpcd[14191]: dhcpcd exited
Mar 21 21:33:39 darkstar rc.inet1[14024]: wlan1: failed to obtain DHCP lease
Mar 21 21:33:38 darkstar kernel: wlan1: deauthenticating from 1c:3b:f3:86:b1:01 by local choice (Reason: 3=DEAUTH_LEAVING)


both suggest that it is a DHCP timeout causing the failure, rather than rc.inet1 - wpa_supplicant has authenticated to the access point, and DHCP started successfully. dhcpcd then does the IP config, which is where it fails on the second phase of the configuration where it asks the DHCP server to authorise the lease of the IP address offered to it.

Quote:

Originally Posted by pakcjo (Post 6232847)
The odd part is that if I just open a terminal and call wpa_supplicant with the exact command as rc.inet1 uses and then call dhclient wlan1 or dhcpcd everything just works...

This could indicate that the DHCP server isn't serving the lease fast enough for dhcpcd to obtain it.
The DHCP_TIMEOUT command I suggested above should help with that.

I wouldn't recommend using dhclient as that's not supported by rc.inet1 - dhcpcd is the standard util to configure DHCP on Slackware.

tadgy 03-22-2021 05:50 AM

Quote:

Originally Posted by kaott (Post 6232849)
I don't think this changed with the update, and the default should be 15 seconds, but maybe it needs more time.

No, nothing changed with the configuration of wlan interfaces or DHCP changed with the most recent update, so I'm unsure what is causing pakjo's problens...

Quote:

Originally Posted by kaott (Post 6232849)
I think the default timeout interval for dhcpcd is 30 seconds

The default timeout is overridden by rc.inet1 and set to 15 seconds by default; but can be increased if the DHCP server is a bit slow; which is what I believe is happening here.

Quote:

Originally Posted by kaott (Post 6232849)
If this doesn't work try setting:
DHCP_DEBUG[4]="yes"
and maybe
DEBUG_ETH_UP="yes"
to see if that helps give more information.

Good suggestion. With DEBUG_ETH_UP set, EVERY command that is run is output to the log, so you'll be able to see exactly how rc.inet1 configured the interface, and what failed where.

pakcjo 03-22-2021 07:41 AM

Hello, increasing the timeout of the dhcp as Tadgy suggested seems to have solved the issue. I changed both the WLAN_WPAWAIT[4] and DHCP_TIMEOUT[4] to 60.

Thanks to everyone for their time and support!


All times are GMT -5. The time now is 01:26 PM.