wpa_supplicant.conf not being processed from rc.conf

choppy812

New Member


Messages: 11

If I reboot and "service netif restart", my RTL8192CU will connect to a random available network, but will not get an IP address. It seems to not be looking at wpa_supplicant.conf.

If I reboot and do "wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf", I will connect to the network specified in wpa_supplicant and get an IP address. However, even though things work, the terminal is not returned to me, and there's a line that reads, "Failed..." as seen here.

Code:
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wlan0: Trying to associate with 00:71:c2:92:34:b0 (SSID='WORK-2.4' freq=2437 MHz)
Failed to add supported operating classes IE
wlan0: Associated with 00:71:c2:92:34:b0
wlan0: WPA: Key negotiation completed with 00:71:c2:92:34:b0 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 00:71:c2:92:34:b0 completed [id=0 id_str=]
Code:
---/etc/rc.conf---
wlans_rtwn0="wlan0"
ifconfig_wlan0="DHCP"
Code:
---/etc/wpa_supplicant.conf---
network={
    ssid="WORK-2.4"
    key_mgmt=WPA-PSK
    psk="...password..."
}
Code:
---/boot/loader.conf---
urtwn-rtl8192cfwT_load="YES"
urtwn-rtl8192cfwU_load="YES"
if_rtwn_pci_load="YES"
if_rtwn_usb_load="YES"
#if_rtwn_load="YES"
legal.realtek.license_ack=1
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
Code:
$ ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 74:da:38:ef:f0:14
    inet 10.1.10.102 netmask 0xffffff00 broadcast 10.1.10.255
    groups: wlan
    ssid WORK-2.4 channel 6 (2437 MHz 11g ht/20) bssid 00:71:c2:92:34:b0
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF TKIP 2:128-bit TKIP 3:128-bit txpower 30 bmiss 7
    scanvalid 60 protmode CTS ht20 ampdulimit 64k ampdudensity 8 shortgi
    -stbc -ldpc wme roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=2b<PERFORMNUD,ACCEPT_RTADV,IFDISABLED,AUTO_LINKLOCAL>
Code:
FreeBSD myFreeBSD.mydomain 12.0-RELEASE-p7 FreeBSD 12.0-RELEASE-p7 GENERIC  amd64
 

ljboiler

Well-Known Member

Reaction score: 103
Messages: 344

Try ifconfig_wlan0="WPA DHCP"; that should automatically start wpa_supplicant in the background when the interface is created.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,680
Messages: 30,598

Yep, the key here being WPA in ifconfig_wlan0. Without it the system simply doesn't know you want to use wpa_supplicant(8), and thus doesn't start it.
 

rpowell47

Member

Reaction score: 2
Messages: 34

If I reboot and "service netif restart", my RTL8192CU will connect to a random available network, but will not get an IP address. It seems to not be looking at wpa_supplicant.conf.

If I reboot and do "wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf", I will connect to the network specified in wpa_supplicant and get an IP address. However, even though things work, the terminal is not returned to me, and there's a line that reads, "Failed..." as seen here.

Code:
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wlan0: Trying to associate with 00:71:c2:92:34:b0 (SSID='WORK-2.4' freq=2437 MHz)
Failed to add supported operating classes IE
wlan0: Associated with 00:71:c2:92:34:b0
wlan0: WPA: Key negotiation completed with 00:71:c2:92:34:b0 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 00:71:c2:92:34:b0 completed [id=0 id_str=]
Code:
---/etc/rc.conf---
wlans_rtwn0="wlan0"
ifconfig_wlan0="DHCP"
Code:
---/etc/wpa_supplicant.conf---
network={
    ssid="WORK-2.4"
    key_mgmt=WPA-PSK
    psk="...password..."
}
Code:
---/boot/loader.conf---
urtwn-rtl8192cfwT_load="YES"
urtwn-rtl8192cfwU_load="YES"
if_rtwn_pci_load="YES"
if_rtwn_usb_load="YES"
#if_rtwn_load="YES"
legal.realtek.license_ack=1
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
Code:
$ ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 74:da:38:ef:f0:14
    inet 10.1.10.102 netmask 0xffffff00 broadcast 10.1.10.255
    groups: wlan
    ssid WORK-2.4 channel 6 (2437 MHz 11g ht/20) bssid 00:71:c2:92:34:b0
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF TKIP 2:128-bit TKIP 3:128-bit txpower 30 bmiss 7
    scanvalid 60 protmode CTS ht20 ampdulimit 64k ampdudensity 8 shortgi
    -stbc -ldpc wme roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=2b<PERFORMNUD,ACCEPT_RTADV,IFDISABLED,AUTO_LINKLOCAL>
Code:
FreeBSD myFreeBSD.mydomain 12.0-RELEASE-p7 FreeBSD 12.0-RELEASE-p7 GENERIC  amd64
In your boot/loader.conf
Add:
rtwnfw_load=“YES”

Or

urtwnfw_load=“YES”
 
OP
OP
C

choppy812

New Member


Messages: 11

Changes made and still not working. I noticed when I went to the office, I was able to connect without problems to that wifi network. So the problem seems to be that the dongle or FreeBSD doesn't like my router at my home office. If I use the dongle on my OpenBSD laptop at my home office, it connects fine to my home wifi.

I noticed on bootup that there was a hang on DHCPDISCOVER after wlan0 came up. So I logged in, killed dhclient and tried dhclient wlan0... same result.

I have a Linksys WRT3200ACM router with dd-wrt firmware. Not sure how to move forward in figuring this out.

Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 74:da:38:ef:f0:14
    inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 
    groups: wlan 
    ssid WORK-2.4 channel 9 (2452 MHz 11g ht/20) bssid 24:f5:a2:2d:ff:db
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 3:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS ht20 ampdulimit 64k ampdudensity 4 shortgi -stbc -ldpc
    wme roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
root@idea5:~ # killall dhclient
root@idea5:~ # dhclient wlan0
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 1
No DHCPOFFERS received.
No working leases in persistent database - sleeping
Code:
----------/etc/rc.conf------------
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
Code:
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
rtwnfw_load="YES"
legal.realtek.license_ack=1
if_rtwn_pci_load="YES"
if_rtwn_usb_load="YES"
 
OP
OP
C

choppy812

New Member


Messages: 11

I take that back... the wifi dongle doesn't work on OpenBSD either; it works, but it associates with a neighbors network. My router's DHCP server works well for wired NICs on Free- and OpenBSD, and it serves up IPs for wifi cards on Linux and windows. I know my password is correct (using simple pass in wpa_supplicant).
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,680
Messages: 30,598

So the problem seems to be that the dongle or FreeBSD doesn't like my router at my home office.
Did you perhaps enable MAC address filtering on your wireless access point?
 
OP
OP
C

choppy812

New Member


Messages: 11

I've tooled around with this a lot -- reinstalled FreeBSD 12 Release and started from scratch. I think I have it fixed. I removed wlan_tkip_load="YES" from /boot/loader.conf and left only wlan_ccmp_load="YES" there. This did the trick on reboot.

I'm also explicitly loading all the firmwares in loader.conf and still need to start removing some... pretty sure I don't need to have them all there.

Code:
# /boot/loader.conf

# per FreeBSD Handbook, 31.3
wlan_ccmp_load="YES"
#wlan_tkip_load="YES"

# per 'man rtwn' for usb edimax EW-7722UTn V2 (rtl8192CU)
# see also 'man rtwn', 'man rtwn_usb', 'man rtwnfw'
# see sysctl dev.rtwn for tuneables (and 'man rtwn')
# rtwn_usb does not support any of the 802.11ac capabilites
# of the adapter. (more work needed).

if_rtwn_usb_load="YES"

# per 'man rtwnfw' can load all firmware images here
# some are not for my usb adapter,
rtwn-rtl8188eufw_load="YES"
rtwn-rtl8192cfwE_B_load="YES"
rtwn-rtl8192cfwE_load="YES"
rtwn-rtl8192cfwT_load="YES"
rtwn-rtl8192cfwU_load="YES"
rtwn-rtl8192eufw_load="YES"
rtwn-rtl8812aufw_load="YES"
rtwn-rtl8821aufw_load="YES"

# per 'man rtwnfw', legal for RealTek
legal.realtek.license_ack=1

Code:
# /etc/rc.conf

# my setup with Edimax
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
Code:
# /etc/wpa_supplicant.conf
network={
    ssid="my_wifi_network"
    psk="my_literal_password_in_quotes"
}
 

rpowell47

Member

Reaction score: 2
Messages: 34

I take that back... the wifi dongle doesn't work on OpenBSD either; it works, but it associates with a neighbors network. My router's DHCP server works well for wired NICs on Free- and OpenBSD, and it serves up IPs for wifi cards on Linux and windows. I know my password is correct (using simple pass in wpa_supplicant).

Try loading pkg wifimgr then open it see what it has detected and click the reconnect and save button. After that view your wpa_supplicant.conf file for any change. You may find the answer there.
 
Top