# Unable to connect to WiFi with Intel AC 9560



## corazone (Jan 25, 2022)

Hi everyone,

I am new to FreeBSD, coming from Linux.
I downloaded FreeBSD 13.0 Release amd64.disc1.iso, using Lenovo IdeaPad C300.

Installed everything with Ethernet cable, however when trying to use WiFi, I'm unable to.
Steps taken:

```
sysctl net.wlan.devices

-> net.wlan.devices: iwm0
```


```
dmesg | grep iwm
->  <Intel(R) Dual Band Wireless AC 9560> mem 0xa1318000-0xa131bfff at device 20.3 on pci0
```

/boot/loader.conf

```
if_iwm_load="YES"
iwm9000fw_load="YES"
```

/etc/rc.conf

```
defaultrouter=192.168...
#ifconfig_ue0="DHCP"
#ifconfig_ue0_ipv6="inet6 accept_rtadv"
wlans_iwm0="wlan0"
ifconfig_wlan="WPA DHCP"
....
wpa_supplicant_enable="YES"
create_args_wlan0="country Croatia regdomain ETSI"
```

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
            ssid="myssid"
            priority=1
            bssid=mymacadress
            key_mgmt=WPA-PSK
            proto=RSN
            psk="mypsk"
}
```


If you need any more information, I am glad to share.
When I scan for networks, it shows them all but it won't connect does not matter what i tried.
User is in video, network and wheel group.

EDIT:  `dhclient wlan0`

```
wlan0:no link .......... giving up
```

`ifconfig wlan0`

```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 84:c5:a6:45:ff:b5
    groups: wlan
    ssid "" channel 36 (5180 MHz 11a)
    regdomain ETSI country HR authmode WPA1+WPA2/802.11i privacy ON
    deftxkey UNDEF txpower 17 bmiss 10 mcastrate 6 mgmtrate 6 scanvalid 60
    wme roaming MANUAL
    parent interface: iwm0
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```



I'm out of any ideas for now.


----------



## SirDice (Jan 25, 2022)

corazone said:


> ```
> network={
> ssid="myssid"
> priority=1
> ...


Just set the `ssid` and the `psk`, remove everything else. 

Then run `service netif restart` and see if wpa_supplicant(8) is correctly started.



corazone said:


> EDIT: `dhclient wlan0`


Has no use if the interface isn't associated. It is similar to doing a DHCP request while the ethernet port is physically disconnected. It's not going to work. 

Check and verify if wpa_supplicant(8) is able to associate with your wireless AP. If that doesn't work then everything else won't work either.


----------



## corazone (Jan 25, 2022)

SirDice said:


> Just set the `ssid` and the `psk`, remove everything else.
> 
> Then run `service netif restart` and see if wpa_supplicant(8) is correctly started.
> 
> ...


Thanks for help. 

I removed everything from /etc/wpa_supplicant.conf

When I type:
service netif restart, I get the following: 

Destroyed wlan(4) interfaces: wlan0
Created wlan(4) intrrfaces: wlan0
Ifconfig: SIOCIFCREATE2: Invalid argument
Starting wpa_supplicant.
Starting Network: lo0 wlan0.
......

Sorry for formatting Im on a phone


----------



## SirDice (Jan 25, 2022)

corazone said:


> ```
> Ifconfig: SIOCIFCREATE2: Invalid argument
> ```


That might be this line: `create_args_wlan0="country Croatia regdomain ETSI"`. Try setting this as `create_args_wlan0="country HR"`.



corazone said:


> ```
> Starting wpa_supplicant.
> ```


Ok, at least it tries to start wpa_supplicant(8). But doesn't seem to work for some reason. Try running it from the commandline, with some debug options set: `wpa_supplicant -d -d -f /etc/wpa_supplicant.conf`. Hopefully this will produce some interesting information.


----------



## corazone (Jan 25, 2022)

> SirDice said:
> 
> 
> > That might be this line: `create_args_wlan0="country Croatia regdomain ETSI"`. Try setting this as `create_args_wlan0="country HR"`
> ...


This is whole /etc/rc.conf 


```
hostname="freebsd"
keymap="hr.kbd"
defaultrouter=192.168..
ifconfig_ue0="DHCP"
ifconfig_ue0_ipv6="inet6 accept_rtadv"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA DHCP"
create_args_wlan0="country HR"
sshd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
wpa_supplicant_enable="YES"
ipv6_privacy="YES"
background_dhclient="YES"
kld_list="i915kms"
dbus_enable="yes"
slim_enable="yes"
sound_load="yes"
snd_hda_load="yes"
```




SirDice said:


> Ok, at least it tries to start wpa_supplicant(8). But doesn't seem to work for some reason. Try running it from the commandline, with some debug options set: `wpa_supplicant -d -d -f /etc/wpa_supplicant.conf`. Hopefully this will produce some interesting information.



I tried with said flags but but it does not recognize -f, so I ran example at the bootom and got:


> Trying to associate with <bssid> (SSID='mywifi' freq=2467 MHz)
> Failed to add supported operating classes IE



I will try with bhyve and openwrt next


----------



## grahamperrin@ (Jan 26, 2022)

`wpa_supplicant_enable` might be superfluous. I see automated stops and starts of the supplicant, without that line.

`background_dhclient` is unusual. 

Simplify. Try removing, or commenting out, both lines. 


Note to self: 


```
% grep -r background_dhclient /usr/doc/documentation/
/usr/doc/documentation/manual-pages/ja/man5/rc.conf.5:.It Va background_dhclient
%
```


----------



## corazone (Jan 26, 2022)

I removed both of them now i get:

```
Destroyed wlan(4) interfaces: wlan0.
Created wlan(4) interfaces: wlan0.
Starting wpa_supplicant.
Starting Network: lo0 wlan0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 84:c5:a6:45:ff:b5
    groups: wlan
    ssid "" channel 1 (2412 MHz 11b)
    regdomain ETSI country HR authmode WPA1+WPA2/802.11i privacy MIXED
    deftxkey UNDEF txpower 30 bmiss 10 scanvalid 60 wme roaming MANUAL
    bintval 0
    parent interface: iwm0
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```


----------



## SirDice (Jan 26, 2022)

Not related to the issue

```
sound_load="yes"
snd_hda_load="yes"
```
Those don't belong in rc.conf, they should go loader.conf. But you don't need to add them there either, these are already included with the GENERIC kernel, so no need to load them.


----------



## corazone (Jan 26, 2022)

Thanks, they are removed.


----------



## corazone (Jan 27, 2022)

I have failed in my quest.

I will keep an eye on the future driver updates and hopefully come back.

Just a quick question 
I saw that thinkpads are well supported, that means any model even the newer ones or older?

I will buy it if it means I can run FreeBSD on laptop, really got sick of Linux.

Thank you all once again for all the help.


----------



## Fuzzbox (Jan 27, 2022)

corazone said:


> I saw that thinkpads are well supported, that means any model even the newer ones or older?



I've seen reports of good hardware support up to the 2019 generation of Thinkpads X, T and X1 series (if you don't expect bluetooth and wireless ac standard support, plus suspend/resume can be unreliable on some models).
The T450s is the most recent that I've personally tested : no problem. A X270 is on its way.


----------



## grahamperrin@ (Jan 28, 2022)

corazone said:


> … I saw that thinkpads are well supported, that means any model even the newer ones or older? …



Generally, not specific to any make or model: check that FreeBSD 13.0-RELEASE can boot. If not, future 13.1-RELEASE should work.


----------



## corazone (Jan 28, 2022)

Thank you guys.


----------

