Solved Ifconfig: wlandev: bad value

Attempting to set up Hostap mode very simply like how the instructions in the handbook suggest. When I issue the command (ifconfig wlan0 create wlandev ath0) it returns with (ifconfig: wlandev: bad value)
This is something not mentioned in the handbook or in these forums or anywhere else I have searched. Please help FBSD community!
 
So the value of the variable wlandev is bad? Do you have a device called ath0?
Try ifconfig ath0.

Quoting from ifconfig()
The following parameters are specific to cloning IEEE 802.11 wireless
interfaces with the create request:

wlandev device
Use device as the parent for the cloned device.
 
ath is a network driver for Atheros network interfaces.

Do you have anything else in ifconfig? Maybe some other card? If not, you'd need to load the driver for your network card. 11.5. Setting Up Network Interface Cards - FreeBSD

I am not sure how to tell if I have a network interface card setup with ifconfig. I dont think think that I do. could you tell me based on my ifconfig output. I see that there are instructions on how to setup this card but are there instructions on how to tell which card I have or driver I need to load?
Code:
root@machine17:~ # ifconfig
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
    ether 00:30:67:b6:b4:d9
    media: Ethernet autoselect (10baseT/UTP <half-duplex>)
    status: no carrier
    nd6 options=21<PERFORMNUD,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>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether a4:2b:8c:e3:69:8d
    inet6 fe80::a62b:8cff:fee3:698d%wlan0 prefixlen 64 scopeid 0x3
    inet 192.168.0.40 netmask 0xffffff00 broadcast 192.168.0.255
    groups: wlan
    ssid CenturyLink4339 channel 6 (2437 MHz 11g ht/20) bssid 5c:e2:8c:d3:e1:0c
    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 4 shortgi
    -stbc -ldpc wme roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33160
    groups: pflog
 
I see only re0, which is ethernet.

You need to load the driver for your wireless card. To see your card, try usbconfig. Or pciconf -lv and look for a card that has class=0x028000, or says WiFi.
 
Following the handbook at example 31.3 I find myself in a similar situation after replacing the ethernet interfaces' MAC with that of the wireles interface by
# ifconfig em0 ether 00:28:f8:48:80:28
Thereafter I am stuck with:
# ifconfig wlan0 create wlandev iwm0 regdomain ETSI country CH ssid MYSSID up
ifconfig: wlandev: bad value

Could any one guide me through this Failover mode example?

This is on 12.2-STABLE r367519 GENERIC amd64 and with:
# pciconf -lv | grep 0x028000
iwm0@pci0:3:0:0: class=0x028000 card=0x10108086 chip=0x24fd8086 rev=0x78 hdr=0x00
# ifconfig
Code:
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=81249b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,WOL_MAGIC,VLAN_HWFILTER>
        ether 00:28:f8:48:80:28
        hwaddr c8:5b:76:e0:98:de
        inet6 fe80::ca5b:76ff:fee0:98de%em0 prefixlen 64 scopeid 0x1
        inet 192.168.178.20 netmask 0xffffff00 broadcast 192.168.178.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>
wlan0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:28:f8:48:80:28
        inet 192.168.178.25 netmask 0xffffff00 broadcast 192.168.178.255
        groups: wlan
        ssid "" channel 6 (2437 MHz 11g)
        regdomain ETSI country CH authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 10 scanvalid 60
        protmode CTS wme roaming MANUAL
        parent interface: iwm0
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
 
# ifconfig wlan0 create wlandev iwm0 regdomain ETSI country CH ssid MYSSID up
wlandev is meant as a variable. In your case it is iwm0.
I have that in /etc/rc.conf to setup the lagg(4) interface:
Code:
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA"
create_args_wlan0="country DE regdomain none"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"
May be it can be simplified to less lines.
 
I have tried how to bring up my wlan from the console. The procedure below worked. The difference to your command is the missing trailing up. Authmode and others seem to be configured elsewhere by wpa_supplicant or so. In the past I have just used the configuration in /etc/rc.conf. Finally most people will do so. Nevertheless may be some expert will correct me if I am wrong;-).
Code:
ifconfig wlan0 create wlandev iwn0 regdomain ETSI country DE ssid Wellensalat
ifconfig wlan0
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 8c:70:5a:cd:28:ec
        groups: wlan
        ssid Wellensalat channel 1 (2412 MHz 11b)
        regdomain ETSI country DE authmode OPEN privacy OFF txpower 30
        bmiss 10 scanvalid 60 wme bintval 0
        parent interface: iwn0
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &
[1] 42020
root@celsius:/usr/home/chris # Successfully initialized wpa_supplicant
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
wlan0: Trying to associate with c4:e9:84:7f:d9:ca (SSID='Wellensalat' freq=2457 MHz)
Failed to add supported operating classes IE
wlan0: Associated with c4:e9:84:7f:d9:ca
wlan0: WPA: Key negotiation completed with c4:e9:84:7f:d9:ca [PTK=CCMP GTK=CCMP]
wlan0: CTRL-EVENT-CONNECTED - Connection to c4:e9:84:7f:d9:ca completed [id=0 id_str=]

dhclient wlan0
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 192.168.0.32
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.32
bound to 192.168.0.60 -- renewal in 2147483647 seconds.

ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 8c:70:5a:cd:28:ec
        inet6 fe80::8e70:5aff:fecd:28ec%wlan0 prefixlen 64 scopeid 0x4
        inet 192.168.0.60 netmask 0xffffff00 broadcast 192.168.0.255
        groups: wlan
        ssid Wellensalat channel 10 (2457 MHz 11g ht/20) bssid c4:e9:84:7f:d9:ca
        regdomain ETSI country DE authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 10 scanvalid 60
        protmode CTS ampdulimit 32k ampdudensity 16 -amsdutx amsdurx shortgi
        -stbc -ldpc -uapsd wme roaming MANUAL
        parent interface: iwn0
        media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
        status: associated
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
 
Back
Top