LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Laptop Wifi, problems with wpa_supplicant and dhcpcd (https://www.linuxquestions.org/questions/slackware-14/laptop-wifi-problems-with-wpa_supplicant-and-dhcpcd-4175609613/)

terook 07-11-2017 12:51 AM

Laptop Wifi, problems with wpa_supplicant and dhcpcd
 
Hello everyone.
I am running Slackware64 14.2 on an Acer Travelmate B115-M and its wireless card is a Broadcom BCM43228. I'm confident that I could have been just fine using wicd, because previously I ran Slackware64 14.1 with it and was ok. However now I'd like to use only wpa_supplicant and dhcpcd and do everything manually when need wifi. So I installed broadcom-sta drivers and blacklisted the conflicting ones(well explained here https://slackbuilds.org/slackbuilds/...com-sta/README), woke up my wlan0 interface with ifconfig, scanned my network with iwlist and configured my /etc/wpa_supplicant.conf with psk obtained by wpa_passphrase. Everything's fine, in fact now I can connect through wlan0 running
Code:

wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf
(I verified that with iwconfig); at this point I know I need an address so I run
Code:

dhcpcd wlan0
and it's output doesn't seem to be different from the eth0 wired one, but after that I am still offline. I don't understand what's wrong, but I think it could be some kind of lacking configuration of dhcpcd in interfacing with wpa_supplicant, so I read man pages for both dhcpcd and dhcpcd-run-hooks, I looked at both /lib/dhcpcd/dhcpcd-run-hooks and /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant, but I still can't figure it out. I tried to use dhclient, but its output is null; however in this case the config file is almost empty so it is not surprising. I prefer to learn how to use dhcpcd properly instead of learning how to configure dhclient, because it worked with wired and because there is something I am really missing. On a side note, I even tried following http://alien.slackbook.org/dokuwiki/...ckware:network editing /etc/rc.d/rc.inet1.conf, but it seems to me that it does the same thing I do manually, automatically, and needless to say it doesn't work.

brobr 07-11-2017 03:18 PM

Sorry I do not know whether this makes any sense but maybe you need to change some settings in the /etc/dhcpcd.conf (for example I had to change interface settings from 'duid' to 'clientid' to get online at work (via eth0)). For the "nohook" option on the last line of dhcpcd.conf, comments refer to wpa_supplicant being started from rc.inet1 or NM; could that be relevant?

Loomx 07-11-2017 04:36 PM

What happens if you run (as root):
Code:

/etc/rc.d/rc.inet1 restart
And what is in your /etc/rc.d/rc.inet1.conf file?

bassmadrigal 07-11-2017 05:36 PM

Can you provide the output from your wpa_supplicant and dhcpcd commands? As well as the output of the following (after you've run the wpa_supplicant and dhcpcd commands):

Code:

iwconfig
ifconfig


terook 07-12-2017 12:11 AM

Thanks everyone for your help!

@brobr: I tried to comment that line; unfortunately nothing has changed.

@Loomx: I think it simply restart my services; I didn't understand exactly when to run that, but I did (after getting the output below), and it gave me the same output when I start the system. My /etc/rc.d/rc.inet1.conf is the same as it was after installing Slackware (I played with that trying to follow AlienBOB's instructions, but then I commented every line I uncommented earlier) so it is:link.

@bassmadrigal: Here's the output:link.

Loomx 07-12-2017 01:12 AM

Well, it looks nearly there :-)
Can you ping the router? 192.168.1.1
Can you ping google on 8.8.8.8?
If so it would indicate a DNS issue.
What is in your /etc/resolv.conf file?

========

ps If it was me, I would uncomment these lines in your /etc/rc.d/rc.inet1.conf and restart the machine to let the Slackware network scripts do their thing:
Code:

IFNAME[4]="wlan0"
USE_DHCP[4]="yes"
WLAN_WPA[4]="wpa_supplicant"

But if you want to do it all manually, I can understand that too :-)

bassmadrigal 07-12-2017 01:21 AM

Ok, so based on your output, you are connected to the access point and getting an IP address, but you still can't ping a domain name after that. Let's try to see if it is a DNS issue or an overall connectivity issue. Can you try pinging 8.8.8.8? Do you get a response or does it still error out? If it errors out, let's see if you can ping the router (192.168.1.1).

Once you have run wpa_supplicant and dhcpcd, can you provide the output of the following?

Code:

ifconfig
cat /etc/resolv.conf
traceroute 192.138.1.1
traceroute 8.8.8.8

And can you remove the -B from your wpa_supplicant command? That will ensure any output is displayed on the command prompt (which means you'll want to open up another terminal to run the other commands). If it is a connectivity issue, wpa_supplicant might provide us beneficial output.

For now, personally, I'd leave your /etc/rc.d/rc.inet1.conf file as is until we figure out the actual connection issue, but if you really wanted to use it, remove the 'yes' from the USE_DHCP[0] entry so it just has opening and closing quotes (this prevents the computer from trying to find an IP from your ethernet connection). Then under the 5th item (which shows up as IFNAME[4] since arrays start at 0), uncomment the IFNAME, USE_DHCP (add 'yes' between the quotes), WLAN_WPA, and WLAN_WPADRIVER variables.

EDIT: Loomx was much faster than me as well as being more succinct with pretty much the exact same info.

terook 07-12-2017 02:28 AM

Ok:
1)link
2)link
3)I did not understand why ping 8.8.8.8 does nothing so i try
Code:

bash-4.3# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data

but same results.
So, is it DNS issue? Why does not happen the same thing with wired eth0? I do not remember setting DNS during system installation. However what do I do now?
[EDIT]Just to be clear, after 2):
Code:

^C
--- 8.8.8.8 ping statistics ---
0 packets transmitted, 0 received

[EDIT2] I forgot ifconfig cat and traceroute, so I rebooted and did it again:link

bassmadrigal 07-12-2017 03:22 PM

Do you have a firewall up? If so, try shutting that down. That seems to be the only logical explanation since everything else seems to be as it should. You might have your firewall to only allow internet through eth0 so wlan0 is being blocked.

And pinging the IP address bypasses the DNS server (as DNS servers are used to translate the web address into the IP address), so if you can't ping 8.8.8.8, then it isn't related to the DNS (especially since you can't even ping your router).

terook 07-12-2017 05:27 PM

Yes, it was the firewall. All this time and never thought about it... Shame on me. However thank you so much for your help. Hope some other n00b will benefit from this post.
Regards.

bassmadrigal 07-12-2017 07:32 PM

No worries. Sometimes we overlook the simplest things :)


All times are GMT -5. The time now is 09:38 PM.