Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Laptop without wireless connection
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Breizh29
n00b
n00b


Joined: 31 Jul 2024
Posts: 3

PostPosted: Mon Sep 16, 2024 12:22 pm    Post subject: Laptop without wireless connection Reply with quote

Hi,

I just installed gentoo for the first time on a laptop and after reboot I have no wireless connection.
I don't have access to Network Manager or netifrc and I think my only choice is to use wpa_supplicant with WPA/WPA2 and dhcpcd support. The kernel is gentoo-kernel-bin.
Can someone tell me the exact procedure to follow?

The solution I used in the network configuration chapter of the gentoo handbook at the beginning of the installation does not work:

nano -w ./network
network={
ssid="my_ssid"
psk="my_password"
}

wpa_supplicant -i wlp3s0 -c ./network -B
dhcpcd wlp3s0

Can someone tell me the exact procedure to follow?
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2266
Location: $TERM

PostPosted: Mon Sep 16, 2024 12:28 pm    Post subject: Reply with quote

To be very honest, I would suggest you stick net-misc/networkmanager and use it's GUI (or nmcli). You'll be saving a lot of headaches for years to come (especially with things like Netplan floating around).

Ok, you don't have a GUI. So you use nmcli and use AI to generate commands to connect to your wireless network.
_________________
My blog
Back to top
View user's profile Send private message
Breizh29
n00b
n00b


Joined: 31 Jul 2024
Posts: 3

PostPosted: Mon Sep 16, 2024 12:39 pm    Post subject: Reply with quote

dE_logics wrote:
To be very honest, I would suggest you stick net-misc/networkmanager and use it's GUI (or nmcli). You'll be saving a lot of headaches for years to come (especially with things like Netplan floating around).

Ok, you don't have a GUI. So you use nmcli and use AI to generate commands to connect to your wireless network.


Unfortunately nmcli answers me: command not found
Back to top
View user's profile Send private message
eeckwrk99
Apprentice
Apprentice


Joined: 14 Mar 2021
Posts: 231
Location: Gentoo forums

PostPosted: Mon Sep 16, 2024 12:46 pm    Post subject: Reply with quote

Breizh29 wrote:
dE_logics wrote:
To be very honest, I would suggest you stick net-misc/networkmanager and use it's GUI (or nmcli). You'll be saving a lot of headaches for years to come (especially with things like Netplan floating around).

Ok, you don't have a GUI. So you use nmcli and use AI to generate commands to connect to your wireless network.


Unfortunately nmcli answers me: command not found


Breizh29 wrote:
I don't have access to Network Manager


nmcli is provided by net-misc/networkmanager:
Code:
% equery belongs nmcli
net-misc/networkmanager-1.46.0-r1 (/usr/share/bash-completion/completions/nmcli)
net-misc/networkmanager-1.46.0-r1 (/usr/bin/nmcli)
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 440
Location: Naarm/Melbourne, Australia

PostPosted: Mon Sep 16, 2024 12:53 pm    Post subject: Reply with quote

Breizh29:

Your post mentions 'wlp3s0', so i presume the interface is available in general, i.e. it's listed in the output of `ip a`? If so, can you confirm that the appropriate firmware package for your wifi adapter has been installed, if necessary? If so, does the output of `rfkill` list the interface as soft- or hard-blocked?

dE_logics wrote:
To be very honest, I would suggest you stick net-misc/networkmanager and use it's GUI (or nmcli).

So, this is a pet gripe of mine: people offering up NM as the solution to any wifi issue.

The problem is, it's not going to help in the case of, for example, kernel misconfiguration, or the relevant firmware not being installed, or the wifi interface being hard-blocked. It's a small-scale version of someone saying "I'm having problems with my Gentoo setup" and getting told "You should install Ubuntu". And also, if one is going to suggest installing NM on a device that doesn't yet have a wifi connection, and possibly no network connection at all if the device doesn't have a built-in Ethernet port, then it's probably best to describe how to sneakernet an appropriate binary onto that device.

i get it: for many (if not most) people, using NM puts various network stuff into the "just works" category. That's not been my own experience with NM; a number of years ago i had issues trying to use it, because it would make incorrect guesses that i would then have to fight. i imagine things have improved since then, but even so, it's left a bad taste in my mouth; i'll be moving off wpa_supplicant in the near future, but it will be to iwd, not NM.

But even so, can we please not jump to the "Just install NM" stuff without first checking that more fundamental parts of the network stack are set up correctly?


Last edited by flexibeast on Mon Sep 16, 2024 1:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Mon Sep 16, 2024 1:07 pm    Post subject: Reply with quote

Hi

FWIW if it's just a matter of getting a wireless internet connection working to run a set-up, I find this procedure works for me. This is not in any way specific to Gentoo.

1. Create a wpa_supplicant config file with one line:

ctrl_interface=DIR=/var/run/wpa_supplicant

(/var/run has to exist).

2. Start wpa_supplicant:

wpa_supplicant -B -i wlan0 -c /path/to/config_file

Of course, wlan0 might not be the right interface in other cases. You might need to install some kernel modules to get the interface to be available, depending on your hardware.

3. Bring up the interface

wpa_cli -i wlan0 set_network 0 ssid [my_ssid]
wpa_cli -i wlan0 set_network 0 psk [my_password]
wpa_cli -i wlan0 enable_network

At this point the wifi adapter should associate to the access point. Then

dhcpcd

or a bunch of iwconflg commands to set the IP, router, DNS, etc.

I wouldn't like to do this as a routine procedure on a desktop system, but I've found it works in an emergency.

BR, Lars.
Back to top
View user's profile Send private message
Breizh29
n00b
n00b


Joined: 31 Jul 2024
Posts: 3

PostPosted: Mon Sep 16, 2024 11:33 pm    Post subject: Reply with quote

lars_the_bear wrote:
Hi

FWIW if it's just a matter of getting a wireless internet connection working to run a set-up, I find this procedure works for me. This is not in any way specific to Gentoo.

1. Create a wpa_supplicant config file with one line:

ctrl_interface=DIR=/var/run/wpa_supplicant

(/var/run has to exist).

2. Start wpa_supplicant:

wpa_supplicant -B -i wlan0 -c /path/to/config_file

Of course, wlan0 might not be the right interface in other cases. You might need to install some kernel modules to get the interface to be available, depending on your hardware.

3. Bring up the interface

wpa_cli -i wlan0 set_network 0 ssid [my_ssid]
wpa_cli -i wlan0 set_network 0 psk [my_password]
wpa_cli -i wlan0 enable_network

At this point the wifi adapter should associate to the access point. Then

dhcpcd

or a bunch of iwconflg commands to set the IP, router, DNS, etc.

I wouldn't like to do this as a routine procedure on a desktop system, but I've found it works in an emergency.

BR, Lars.


Thanks for the answer.

I have a "FAIL" answer for the wpa_cli -i wlp3s0 set_network ssid [my_ssid]
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Tue Sep 17, 2024 8:36 am    Post subject: Reply with quote

Breizh29 wrote:

I have a "FAIL" answer for the wpa_cli -i wlp3s0 set_network ssid [my_ssid]


Is 'wlp3s0' the correct interface name? Can you run 'iwconflg' on it and get better than an error message? Is it one of those wireless adapters that needs proprietary firmware to be installed?

BR, Lars.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1910

PostPosted: Tue Sep 17, 2024 12:22 pm    Post subject: Reply with quote

lars_the_bear wrote:
Is 'wlp3s0' the correct interface name? Can you run 'iwconflg' on it and get better than an error message? Is it one of those wireless adapters that needs proprietary firmware to be installed?.

Don't use iwconfig ever. It is outdated and broken on many kernels. If you must use a low level tool, use iw command.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Tue Sep 17, 2024 12:37 pm    Post subject: Reply with quote

grknight wrote:
lars_the_bear wrote:
Is 'wlp3s0' the correct interface name? Can you run 'iwconflg' on it and get better than an error message? Is it one of those wireless adapters that needs proprietary firmware to be installed?.

Don't use iwconfig ever. It is outdated and broken on many kernels. If you must use a low level tool, use iw command.


I doubt it's so broken that it won't safely tell you whether an interface exists.

BR, Lars.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1910

PostPosted: Tue Sep 17, 2024 1:17 pm    Post subject: Reply with quote

lars_the_bear wrote:
I doubt it's so broken that it won't safely tell you whether an interface exists..

Yes, it will just fail for that as well. iwconfig relies on a kernel shim implemented in 2007 which I've heard talk of removal somewhere.
Fedora has removed support and Gentoo kernels are often built without this shim option as well.

Any reference to iwconfig should be removed from any conversation going forward. The replacement tool is iw.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Tue Sep 17, 2024 1:26 pm    Post subject: Reply with quote

[quote="grknight"]
lars_the_bear wrote:
iwconfig relies on a kernel shim implemented in 2007 which I've heard talk of removal somewhere.


Sigh. I doubt the Gentoo stage3 even has iwconfig. Of course you'll have to use whatever tool is available. My point was... oh, what's the point. I give up.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum