# Problem with wpa_supplicant (wlan0 no carrier)



## C0gito (Jun 10, 2016)

Hello,

I've got a little problem with my WLAN-Configuration. The WLAN-Card of my laptop is not supported by FreeBSD, so I bought an USB adapter with a Realtek RTL 8192CU chip.
Then I put the lines

```
if_urtwn_load="YES"
legal.realtek.license_ack=1
```
into my /boot/loader.conf like described in urtwn(4).
The /etc/rc.conf contains:

```
ifconfig_alc0="DHCP"       # for Ethernet-LAN
wlans_urtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
#ifconfig_urtwn0="DHCP"
```
The output of `ifconfig wlan0 list scan` is

```
SSID/MESH ID  BSSID  CHAN RATE  S:N  INT CAPS
UPC246152873  14:49:e0:d9:e3:98  1  54M -54:-95  100 EP  WPS HTCAP RSN WME
UPC246536782  f8:04:2e:8e:f0:c8  6  54M -57:-95  100 EP  HTCAP RSN WME WPS
UPC242585275  54:88:0e:b1:19:18  11  54M -45:-95  100 EP  HTCAP RSN WME WPS
UPC3128905  88:f7:c7:9b:63:cb  7  54M -43:-95  100 EP  RSN HTCAP WPA WME
Winter  c8:0e:14:64:df:f1  8  54M -63:-95  100 EPS  HTCAP WME ATH RSN WPS
UPC3267560  88:f7:c7:dc:88:a3  9  54M -63:-95  100 EP  RSN HTCAP WPA WME
```
, which proofs that the WLAN USB-device is working.

However, after I wrote the network configuration (SSID and psk)

```
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1
network={
   ssid="UPC3128905"
   psk="QHFK****"
}
```
into /etc/wpa_supplicant.conf, I cannot connect to the WLAN-network. When I try to start the wireless device using `service netif restart` (FreeBSD manual section 30.3.2) I get:

```
dhclient not running? (check /var/run/dhclient.alc0.pid).
/etc/rc.d/netif: WARNING: wlan0 does not exist.  Skipped.
Stopping Network: lo0 alc0 urtwn0.
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
   options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
alc0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
   options=c319a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MCAST,WOL_MAGIC,VLAN_HWTSO,LINKSTATE>
   ether 44:8a:5b:ef:f3:5c
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: Ethernet autoselect
urtwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
   ether ff:ff:ff:ff:ff:ff
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
   status: no carrier
Starting wpa_supplicant.
Starting Network: lo0 alc0 urtwn0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
   options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
   inet6 ::1 prefixlen 128
   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
   inet 127.0.0.1 netmask 0xff000000
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
alc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   options=c319a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MCAST,WOL_MAGIC,VLAN_HWTSO,LINKSTATE>
   ether 44:8a:5b:ef:f3:5c
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: Ethernet autoselect (none)
   status: no carrier
urtwn0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
   ether ff:ff:ff:ff:ff:ff
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
   status: associated
```
Although _urtwn0_ device in _ifonfig_ has the status "associated", the command `ifconfig wlan0` shows "no carrier":

```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   ether ff:ff:ff:ff:ff:ff
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
   status: no carrier
   ssid "" channel 7 (2442 MHz 11g)
   country US authmode WPA1+WPA2/802.11i privacy MIXED deftxkey UNDEF
   txpower 0 bmiss 7 scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250
   roam:rssi 7 roam:rate 5 protmode CTS roaming MANUAL bintval 0
```

Therefore I tryed to configure the interface manually using 
`wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf`

```
Successfully initialized wpa_supplicant
ioctl[SIOCS80211, op=103, val=0, arg_len=128]: Device not configured
wlan0: Failed to initiate AP scan
ioctl[SIOCS80211, op=103, val=0, arg_len=128]: Device not configured
wlan0: Failed to initiate AP scan
```
and then to launch dhclient(8) to get the IP-address from the DHCP server with `dhclient wlan0`:

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

I suppose the problem to be either with `wpa_supplicant` or `dhclient`. Section 30.3.8 of the manual recommends to use wpa_supplicant with the -dd option, but the output of `wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -dd >& out.txt`

```
wpa_supplicant v2.0
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
eapol_version=2
ap_scan=1
fast_reauth=1
Line: 9 - start of a new network block
ssid - hexdump_ascii(len=10):
  55 50 43 33 31 32 38 39 30 35  UPC3128905   
PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 0
  id=0 ssid='UPC3128905'
wpa_driver_bsd_capa: drivercaps=0x2181c001,cryptocaps=0x00000000
wlan0: Own MAC address: ff:ff:ff:ff:ff:ff
bsd_set_key: alg=0 addr=0x0 key_idx=0 set_tx=0 seq_len=0 key_len=0
bsd_del_key: key_idx=0
bsd_set_key: alg=0 addr=0x0 key_idx=1 set_tx=0 seq_len=0 key_len=0
bsd_del_key: key_idx=1
bsd_set_key: alg=0 addr=0x0 key_idx=2 set_tx=0 seq_len=0 key_len=0
bsd_del_key: key_idx=2
bsd_set_key: alg=0 addr=0x0 key_idx=3 set_tx=0 seq_len=0 key_len=0
bsd_del_key: key_idx=3
wpa_driver_bsd_set_countermeasures: enabled=0
wlan0: RSN: flushing PMKID list in the driver
wlan0: Setting scan request: 0 sec 100000 usec
WPS: Set UUID for interface wlan0
WPS: UUID based on MAC address - hexdump(len=16): 32 8c a6 57 e0 fa 54 6e ba e7 d3 90 05 da 90 13
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: Supplicant port status: Unauthorized
EAPOL: Supplicant port status: Unauthorized
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
wlan0: State: DISCONNECTED -> SCANNING
wlan0: Starting AP scan for wildcard SSID
wpa_driver_bsd_set_wpa: enabled=1
wpa_driver_bsd_set_wpa_internal: wpa=3 privacy=1
ioctl[SIOCS80211, op=103, val=0, arg_len=128]: Device not configured
wlan0: Failed to initiate AP scan
wlan0: State: SCANNING -> DISCONNECTED
wlan0: Setting scan request: 1 sec 0 usec
EAPOL: disable timer tick
EAPOL: Supplicant port status: Unauthorized
wlan0: State: DISCONNECTED -> SCANNING
wlan0: Starting AP scan for wildcard SSID
wpa_driver_bsd_set_wpa: enabled=1
wpa_driver_bsd_set_wpa_internal: wpa=3 privacy=1
ioctl[SIOCS80211, op=103, val=0, arg_len=128]: Device not configured
wlan0: Failed to initiate AP scan
```
isn't very useful for me. The wired connection to the router with an Ethernet-cable works without any problems. If anyone has an idea how to solve this, please let me know.
Thanks for reading and for you help.


----------



## miklosq (Dec 23, 2018)

It looks like you're missing the _wlan0_ interface.
_



			/etc/rc.d/netif: WARNING: wlan0 does not exist.  Skipped.
		
Click to expand...

_

Try first stopping the _netif_ service:

```
service netif stop
```
Then do:

```
ifconfig wlan0 create wlandev urtwn0
```

Then start over the _netif_ service again .


----------



## SirDice (Dec 24, 2018)

Versions below 11.0 showed the wireless interface with ifconfig(8), versions above 11.0 don't. So you're likely working with an old and unsupported version. FreeBSD 11.2 is the lowest, still supported, version at the moment.

Topics about unsupported FreeBSD versions


----------

