Configure a Wi-Fi client on a FreeBSD Virtual Machine

With the new FreeBSD VM created with a (passthru WiFi network device), now it is time to configure the WiFi device and make it work.

check the passthru device

# pciconf -lv | grep -B3 network
iwlwifi0@pci0:0:5:0:    class=0x028000 rev=0x1a hdr=0x00 vendor=0x8086 device=0x2723 subvendor=0x8086 subdevice=0x0084
    vendor     = 'Intel Corporation'
    device     = 'Wi-Fi 6 AX200'
    class      = network

create wlan with SSID

# ifconfig wlan0 create wlandev iwlwifi0 regdomain fcc country US ssid SpectrumSetup mode 11a channel 157

authenticate wlan0 with an Access Point (AP)

# wpa_passphrase "YOUR_SSID" "YOUR_WPA2passphrase" >> /etc/wpa_supplicant.conf
# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf

check wlan0 status

This shows the WiFi device is associated with the AP.

# ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=0
        ether e0:2e:0b:92:e5:82
        groups: wlan
        ssid SpectrumSetup channel 157 (5785 MHz 11a) bssid f4:69:42:57:3f:0e
        regdomain FCC country US authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 3:128-bit txpower 23 bmiss 7 mcastrate 6
        mgmtrate 6 scanvalid 60 wme roaming MANUAL
        parent interface: iwlwifi0
        media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11a
        status: associated
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

get an IP address by DHCP

# dhclient wlan0
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
Bogus Host Name option 12: n1_iwl_vm (n1_iwl_vm)
bound to 192.168.1.214 -- renewal in 21600 seconds.

# ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=0
        ether e0:2e:0b:92:e5:82
        inet 192.168.1.214 netmask 0xffffff00 broadcast 192.168.1.255
        groups: wlan
        ssid SpectrumSetup channel 157 (5785 MHz 11a) bssid f4:69:42:57:3f:0e
        regdomain FCC country US authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 3:128-bit txpower 23 bmiss 7 mcastrate 6
        mgmtrate 6 scanvalid 60 wme roaming MANUAL
        parent interface: iwlwifi0
        media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11a
        status: associated
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>


chengcui/Configure_a_Wi-Fi_passthru_on_FreeBSD_VM (last edited 2023-12-20T15:13:45+0000 by chengcui)