# [SOLVED]NetworkManager WiFi unavailable

## OmamoriIchika

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

```
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 201Last edited by OmamoriIchika on Tue Mar 02, 2021 6:13 pm; edited 1 time in total

----------

## Fitzcarraldo

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:

```
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.)

```
clevow230ss ~ # grep -v "^#\|^$" /etc/conf.d/netmount

rc_need="NetworkManager"
```

```
clevow230ss ~ # rc-update show -v | grep -i net

       NetworkManager |      default                           

                local |      default nonetwork                 

           net-online |                                        

         net.enp4s0f1 |                                        

               net.lo |                                        

             netmount |      default
```

```
clevow230ss ~ # rc-update show -v | grep -i dhcp

               dhcpcd |                                        

                dhcpd |
```

```
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 ~ #
```

```
clevow230ss ~ #  grep -v "^#\|^$" /etc/hosts

127.0.0.1       clevow230ss     localhost

::1             clevow230ss     localhost
```

Obviously replace 'clevow230ss' with your own hostname.

```
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.

 

```
clevow230ss ~ # cat /etc/conf.d/hostname

# Set to the hostname of this machine

hostname="clevow230ss"
```

```
clevow230ss ~ # cat /etc/hostname

clevow230ss
```

```
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:

```
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.

----------

## OmamoriIchika

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 

```
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]

----------

## Fitzcarraldo

 *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.

----------

## bdien

 *OmamoriIchika wrote:*   

> 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 
> 
> ```
> ...

 

Thank you! My problem is similar, iw found wlan0 interface, but networkmanager says unavaible. The problem is that iwd service is not running successfully due to missing kernel config(Cryptographic API)

I configured it to run successfully!

----------

