Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]NetworkManager WiFi unavailable
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
OmamoriIchika
n00b
n00b


Joined: 27 Jan 2021
Posts: 58
Location: Taiwan/Japan

PostPosted: Tue Mar 02, 2021 3:18 pm    Post subject: [SOLVED]NetworkManager WiFi unavailable Reply with quote

My networkmanager can only connect to wired connection but not WiFi, and nmcli device show

Code:
wlp0s20f3 WiFi unavailable


I do found the way to solve this problem
https://askubuntu.com/questions/211347/networkmanager-refuses-to-manage-my-wlan-interface
But I can’t find /etc/network/interfaces

Anyone have idea to solved this problem on gentoo?

I emerge networkmanager with iwd and wifi flags.
My network card is intel 6 AX 201


Last edited by OmamoriIchika on Tue Mar 02, 2021 6:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1990
Location: United Kingdom

PostPosted: Tue Mar 02, 2021 5:47 pm    Post subject: Reply with quote

The directory /etc/network/interfaces does not exist in my Gentoo installations nor my more-modern *buntu installations -- all of which use NetworkManager -- and it is is not required.

How precisely have you installed and configured networking and NetworkManager? Things should look something like the following:

Code:
clevow230ss ~ # eix -I net-misc/networkmanager
[I] net-misc/networkmanager
     Available versions:  [M]~1.22.10-r12^t 1.26.4^t ~1.26.6^t ~1.28.0-r1^t {audit bluetooth +concheck connection-sharing debug (+)dhclient dhcpcd elogind examples (+)gnutls gtk-doc (+)introspection iwd json libpsl lto (+)modemmanager ncurses (+)nss ofono ovs (+)policykit (+)ppp resolvconf selinux syslog systemd teamd test +tools vala (+)wext +wifi ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" KERNEL="linux"}
     Installed versions:  1.26.4^t(00:33:18 02/01/21)(bluetooth dhclient elogind introspection modemmanager ncurses nss policykit ppp wext wifi -audit -connection-sharing -dhcpcd -gnutls -iwd -json -ofono -ovs -resolvconf -selinux -systemd -teamd -test -vala ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" KERNEL="linux")
     Homepage:            https://wiki.gnome.org/Projects/NetworkManager
     Description:         A set of co-operative tools that make networking simple and straightforward

(Compare the enabled and disabled USE flags with those in your installed version of NetworkManager.)

Code:
clevow230ss ~ # grep -v "^#\|^$" /etc/conf.d/netmount
rc_need="NetworkManager"


Code:
clevow230ss ~ # rc-update show -v | grep -i net
       NetworkManager |      default                           
                local |      default nonetwork                 
           net-online |                                       
         net.enp4s0f1 |                                       
               net.lo |                                       
             netmount |      default


Code:
clevow230ss ~ # rc-update show -v | grep -i dhcp
               dhcpcd |                                       
                dhcpd |


Code:
clevow230ss ~ # rc-status
Runlevel: default
 dbus                                                       [  started  ]
 NetworkManager                                             [  started  ]
 netmount                                                   [  started  ]
 syslog-ng                                                  [  started  ]
 cupsd                                                      [  started  ]
 samba                                                      [  started  ]
 cronie                                                     [  started  ]
 clamd                                                      [  started  ]
 bluetooth                                                  [  started  ]
 xdm                                                        [  started  ]
 wsdd                                                       [  started  ]
 cups-browsed                                               [  started  ]
 sshd                                                       [  started  ]
 local                                                      [  started  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
 xdm-setup                                                  [  started  ]
 avahi-daemon                                               [  started  ]
Dynamic Runlevel: manual
clevow230ss ~ #


Code:
clevow230ss ~ #  grep -v "^#\|^$" /etc/hosts
127.0.0.1       clevow230ss     localhost
::1             clevow230ss     localhost


Obviously replace 'clevow230ss' with your own hostname.

Code:
clevow230ss ~ # grep -v "^#\|^$" /etc/dhcp/dhclient.conf
send host-name "clevow230ss";
supersede host-name "clevow230ss";

The supersede statement in dhclient.conf has the following purpose:

man dhclient.conf(5) wrote:
supersede [ option declaration ] ;

If for some option the client should always use a locally-configured value or values rather than whatever is supplied by the server, these values can be defined in the supersede statement.


Code:
clevow230ss ~ # cat /etc/conf.d/hostname
# Set to the hostname of this machine
hostname="clevow230ss"


Code:
clevow230ss ~ # cat /etc/hostname
clevow230ss


Code:
clevow230ss ~ # cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=keyfile
rc-manager=none
dhcp=dhclient
no-auto-default=*

[keyfile]
hostname=clevow230ss

In earlier days it was necessary to specify the hostname in /etc/NetworkManager/NetworkManager.conf but that is no longer required. According to NetworkManager.conf(5) man page, 'This key is deprecated and has no effect since the hostname is now stored in /etc/hostname or other system configuration files according to build options.' I just left it in the file because it does no harm.

What is in the NetworkManager configuration file for your Wi-Fi connection? That file is normally created automatically when you use the GUI network configuration widget (e.g. kde-plasma/plasma-nm in the case of KDE) but can also be edited manually. For example, the NetworkManager file for my home Wi-Fi connection contains the following:

Code:
clevow230ss ~ # cat /etc/NetworkManager/system-connections/BT-5DF82T.nmconnection
[connection]
id=BT-5DF82T
uuid=3190e9d6-961f-38ab-fb90-1d323e6f35d2
type=wifi
autoconnect=false
permissions=

[wifi]
mac-address-blacklist=
mode=infrastructure
ssid=BT-5DF82T

[wifi-security]
key-mgmt=wpa-psk
psk-flags=1

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

NetworkManager generates the UUID automatically, but it could be generated manually (I've never bothered):

Quote:
The UUID values in the config files must be unique. You can use uuidgen command line tool to generate such values. Alternatively, you can leave out UUID entirely. In that case NetworkManager will generate a UUID based on the file name.

Ref. https://developer.gnome.org/NetworkManager/unstable/nm-settings-ifcfg-rh.html


Additional reading: NetworkManager and hostname config files

EDIT: Fixed typo in one of the cat commands.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog


Last edited by Fitzcarraldo on Thu Mar 04, 2021 10:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
OmamoriIchika
n00b
n00b


Joined: 27 Jan 2021
Posts: 58
Location: Taiwan/Japan

PostPosted: Tue Mar 02, 2021 6:10 pm    Post subject: Reply with quote

Ok, I found the problem about networkmanager+iwd. If you emerge networkmanager with only iwd flag the nmcli result will always show your WiFi is unavailable, this is the problem with gobject introspection, so if you want to solve this problem you have to emerge networkmanager with iwd and introspection flags.

If networkmanager start before iwd it would still show WiFi unavailable, so the solution is put iwd to boot and networkmanager to default, otherwise the
Code:
nmcli device Wifi list
would still show nothing.

If you have problem to put iwd to boot than you most restart networkmanager after you stared iwd.

I hope someone can edit the iwd and networkmanager wiki page to mention this problem.

The source I found out the problem is here: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/101[/post]
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1990
Location: United Kingdom

PostPosted: Tue Mar 02, 2021 6:32 pm    Post subject: Reply with quote

OmamoriIchika wrote:
I hope someone can edit the iwd and networkmanager wiki page to mention this problem.

The Gentoo Wiki is editable by the user community, so you can edit it to mention your problem and solution.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
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