wifi not working with D-Link dongle

Hello,

I have a D-Link DWA-160 wifi dongle that I have used previously on a laptop for which the built-in wifi did not work. On my current laptop (an old MacBook pro with the BCM4331 chip) I cannot get the dongle to work in FreeBSD-RELEASE-13.4.

This s what I have tried:

sudo ifconfig wlan0 create wlandev run0
sudo ifconfig wlan0 up
sudo ifconfig wlan0 scan

Output:
Code:
SSID/MESH ID                      BSSID              CHAN RATE    S:N     INT CAPS
                                  0c:ac:8a:af:f7:1a   44   54M  -13:-22   100 EP   RSN BSSLOAD HTCAP VHTCAP VHTOPMODE VHTPWRENV WPS WME
POOP666                           0e:ac:8a:af:f7:1b   48   54M  -14:-24   100 EP   RSN BSSLOAD APCHANREP HTCAP VHTCAP VHTOPMODE VHTPWRENV WPS WME

I created a wpa_supplicant.conf in /etc:

Code:
network={
        ssid="POOP666"
        #+ any_bssid
        proto=RSN
        psk="secret"
}

Then 'sudo service netif restart' ouputs

Code:
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=c019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
        ether ac:87:a3:34:ab:f1
        inet6 fe80::ae87:a3ff:fe34:abf1%bge0 prefixlen 64 scopeid 0x1
        inet 192.168.2.16 netmask 0xffffff00 broadcast 192.168.2.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
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 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
pflog0: flags=100<PROMISC> metric 0 mtu 33160
        groups: pflog
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 6c:72:20:02:d8:16
        groups: wlan
        ssid "" channel 1 (2412 MHz 11g)
        regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7
        scanvalid 60 protmode CTS wme bintval 0
        parent interface: run0
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
rtsol: sendmsg on bge0: Permission denied
rtsol: sendmsg on bge0: Permission denied
rtsol: sendmsg on bge0: Permission denied
Starting wpa_supplicant.
Starting Network: lo0 bge0 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 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=c019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
        ether ac:87:a3:34:ab:f1
        inet6 fe80::ae87:a3ff:fe34:abf1%bge0 prefixlen 64 scopeid 0x1
        inet 192.168.2.16 netmask 0xffffff00 broadcast 192.168.2.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 6c:72:20:02:d8:16
        groups: wlan
        ssid "" channel 10 (2457 MHz 11g)
        regdomain FCC country US authmode WPA1+WPA2/802.11i privacy MIXED
        deftxkey UNDEF txpower 30 bmiss 7 scanvalid 60 protmode CTS wme
        roaming MANUAL
        parent interface: run0
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

I appreciate any help in getting this to work.
Thanks,
sprock
 
I have a D-Link DWA-160 wifi dongle that I have used previously on a laptop for which the built-in wifi did not work. On my current laptop (an old MacBook pro with the BCM4331 chip) I cannot get the dongle to work in FreeBSD-RELEASE-13.4.
Was this dongle previously used with FreeBSD? Same version or newer?

There are many versions of DWA-160. Which version do you have?
RALink using run(4)? If so make sure you are loading firmware too.

runfw_load="YES"
 
this is what i use with my Ralink alfa card which use run0
as Phishfry pointed out

Code:
sudo vi /boot/loader.conf

Code:
if_run_load="YES"
runfw_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

Code:
sudo vi /etc/rc.conf

Code:
wlans_run0="wlan0"
ifconfig_wlan0="WPA DHCP"
 
The card uses the run driver and I have used it with FreeBSD before, probably 12.X.

I added the loader instructions to loader.conf.

This is my current wpa_supplicant.conf:

Code:
network={
    ssid="POOP666"
    psk="SECRET"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
}

ifconfig still gives:

Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 6c:72:20:02:d8:16
    groups: wlan
    ssid "" channel 48 (5240 MHz 11a ht/20)
    regdomain FCC country US authmode WPA1+WPA2/802.11i privacy ON
    deftxkey UNDEF txpower 17 bmiss 7 mcastrate 6 mgmtrate 6 scanvalid 60
    ht20 ampdulimit 8k ampdudensity 2 -stbc -ldpc -uapsd wme
    roaming MANUAL
    parent interface: run0
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Thanks again.
 
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
I dunno about these settings.
I would never want to connect to a WEP network. That is broken.
The other two modules should fire off automatically with wireless. I would drop them unless troubleshooting.

This from 12 years ago. Hardware has only gotten faster.
It took me ~45 minutes to get enough IVs to crack my WEP key.
 
POOP666 is the name I substituted for the real network name in my post (paranoia).

Maybe it is time to replace the dongle. Any known good ones to choose from?
 
Back
Top