Solved hostapd not starting with wpa2 on Realtek RTL8188CE

Hostapd starts without wpa2 but doesn't start with wpa2. Have I forgotten something here?

pciconf -lv for the card I'm using:
Code:
rtwn0@pci0:2:0:0:    class=0x028000 rev=0x01 hdr=0x00 vendor=0x10ec device=0x8176 subvendor=0x10ec subdevice=0x8211
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8188CE 802.11b/g/n WiFi Adapter'
    class      = network

rc.conf:
Code:
hostname="satania"
keymap="se.kbd"
ifconfig_ue0="DHCP"
interface=wlan0
ifconfig_ue0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
apache24_enable="yes"

#wireless
wlans_rtwn0="wlan0"
ifconfig_wlan0="DHCP"
create_args_wlan0="wlanmode hostap"

ifconfig for the device:
Code:
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 44:6d:57:0c:d1:e8
	groups: wlan
	ssid satania channel 6 (2437 MHz 11g)
	regdomain FCC country US authmode OPEN privacy OFF txpower 30
	scanvalid 60 protmode CTS wme dtimperiod 1 -dfs
	parent interface: rtwn0
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
	status: no carrier
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

hostapd config in /etc/hostapd.conf
Code:
interface=wlan0
#driver=rtwn0

ssid=satania
channel=6
hw_mode=g
macaddr_acl=0
auth_algs=3

## wpa security
#wpa=2
#wpa_passphrase="passphrase"
#wpa_key_mgmt=WPA-PSK
#wpa_pairwise=TKIP
#rsn_pairwise=CCMP

## disable invisibe mode
ignore_broadcast_ssid=0

If I run hostapd /etc/hostapd.conf with the wpa security lines commented out:
Code:
root@satania:/home/ove # hostapd /etc/hostapd.conf 
Configuration file: /etc/hostapd.conf
Using interface wlan0 with hwaddr 44:6d:57:0c:d1:e8 and ssid "satania"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
(working!!!)

If I run hostapd when the lines wpa security lines are uncommented:
Code:
root@satania:/home/ove # hostapd /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
Using interface wlan0 with hwaddr 44:6d:57:0c:d1:e8 and ssid "satania"
ioctl[SIOCS80211, op=7, val=5, arg_len=0]: Invalid argument
bsd_set_ieee8021x: Failed to enable WPA/802.1X
IEEE 802.1X initialization failed.
Interface initialization failed
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED 
wlan0: Unable to setup interface.
wlan0: interface state DISABLED->DISABLED
wlan0: AP-DISABLED 
wlan0: CTRL-EVENT-TERMINATING 
hostapd_free_hapd_data: Interface wlan0 wasn't started

if the "#driver=rtwn0" is uncommented in hostapd.conf:
Code:
root@satania:/home/ove # hostapd /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
Line 2: invalid/unknown driver 'rtwn0'
1 errors found in configuration file '/etc/hostapd.conf'
Failed to set up interface with /etc/hostapd.conf
Failed to initialize interface
 
Have I forgotten something here?
Don't use DHCP on an interface that's going to be the AP. There is nothing on that wireless network (you're creating it), so you can't use DHCP there.
 
Don't use DHCP on an interface that's going to be the AP. There is nothing on that wireless network (you're creating it), so you can't use DHCP there.

I removed the DHCP but the problem still persisted, I probably forgot to remove it after checking if the card worked, thanks for the heads up on that tho

After removing DHCP I loaded wlan_xauth and the problem went away! :D
Code:
kldload wlan_xauth

and in /boot/loader.conf:
Code:
wlan_xauth_load="YES"
 
Back
Top