From owner-freebsd-net@freebsd.org Wed Jun 10 11:39:55 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D69873312EA for ; Wed, 10 Jun 2020 11:39:55 +0000 (UTC) (envelope-from shuriku@shurik.kiev.ua) Received: from mail.flex-it.com.ua (mail.flex-it.com.ua [193.239.74.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49hlQf65KCz3bl5 for ; Wed, 10 Jun 2020 11:39:54 +0000 (UTC) (envelope-from shuriku@shurik.kiev.ua) Received: from mail.lissoft.com.ua ([109.237.91.29] helo=thinkpad.flex-it.com.ua) by mail.flex-it.com.ua with esmtpsa (TLS1.3) tls TLS_AES_128_GCM_SHA256 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1jiz5D-000513-GY for freebsd-net@freebsd.org; Wed, 10 Jun 2020 14:39:51 +0300 Subject: Re: WiFi with AC on FreeBSD To: freebsd-net@freebsd.org References: <20200610082552.0e08045c@rimwks> From: Alexandr Krivulya Message-ID: <1a5446ca-30c1-7b56-91db-66c9f5203dea@shurik.kiev.ua> Date: Wed, 10 Jun 2020 14:39:46 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200610082552.0e08045c@rimwks> Content-Language: en-US X-Rspamd-Queue-Id: 49hlQf65KCz3bl5 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of shuriku@shurik.kiev.ua designates 193.239.74.7 as permitted sender) smtp.mailfrom=shuriku@shurik.kiev.ua X-Spamd-Result: default: False [-0.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[shurik.kiev.ua]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.36)[-0.357]; NEURAL_HAM_MEDIUM(-0.44)[-0.436]; NEURAL_SPAM_SHORT(0.76)[0.762]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:35297, ipnet:193.239.72.0/22, country:UA]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 11:39:55 -0000 10.06.20 08:25, Rozhuk Ivan пишет: > Hi! > > For peoples who want to use linux WiFi drivers on FreeBSD with minimum support overhead :) > > This "how-to" (draft) describes how to use OpenWRT as driver with web GUI for WiFi adapters. > No more pain with slow speed, no strange wpa_supplicant gui tools :) > > This upgrades WiFi speed from > media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11a > to 866Mbps on my notebook with intel 8265. > > > Resourses required: > - 256 Mb ram > - 128 Mb on hard drive > - IOMMU support > - FreeBSD AMD64 > > > 1. Download EFI based build. > WWW: https://openwrt.org/docs/guide-developer/uefi-bootable-image > cd /root/ > fetch https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-x86-64-generic-squashfs-combined-efi.img.gz > gunzip openwrt-x86-64-generic-squashfs-combined-efi.img.gz > > > 2. Install sysutils/bhyve-firmware from ports. > CSM not required. > Patch required to build port (last attached): > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211074 > > > 3. Configure system: > WWW: > https://www.freebsd.org/doc/handbook/virtualization-host-bhyve.html > https://wiki.freebsd.org/bhyve/pci_passthru > > echo 'net.link.tap.up_on_open=1' >> /etc/sysctl.conf > > > /etc/rc.conf: > kld_list="nmdm vmm" > cloned_interfaces="tap0" > ifconfig_tap0_name="wifi0" > ifconfig_wifi0="DHCP up" > ifconfig_wifi0_ipv6="inet6 accept_rtadv auto_linklocal -ifdisabled" > > > /boot/loader.conf > # bhyve PCI device passthru. > # "1/0/0" - PCI dev ident, see: pciconf -lv > pptdevs="1/0/0" > > # For AMD systems > hw.vmm.amdvi.enable="1" > > > 4. Start OpenWRT > > /usr/sbin/bhyvectl --destroy --vm=owrt > /usr/sbin/bhyve \ > -A \ > -H \ > -c 2 \ > -m 256M \ > -S \ > -s 0:0,hostbridge \ > -s 1:0,lpc -l com1,stdio \ > -s 3:0,ahci-hd,openwrt-x86-64-generic-squashfs-combined-efi.img \ > -s 5:0,e1000,tap0,mac=00:be:fa:76:45:01 \ > -s 7,passthru,1/0/0 \ > -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ > owrt > > To disable output remove: "-l com1,stdio" > "1/0/0" - PCI dev ident, same as in loader.conf. > > > 5. Configure OpenWRT: > uci set network.lan.ipaddr='172.16.0.49' > uci set network.lan.netmask='255.255.255.0' > uci set network.lan.gateway='172.16.0.254' > uci add_list network.lan.dns='172.16.0.254' > uci commit network > /etc/init.d/network restart > > opkg update > opkg install luci > > Now web GUI can be used to install wpad*, hostapd*, WiFi driver and other staff. > > If you want use OpenWRT as bridge - read this: https://openwrt.org/docs/guide-user/network/wifi/relay_configuration > Better to start with simple rourer+nat mode. > Hi, Ivan! I'm using the same approach ;) when I need 802.11n or ac connection. The only difference is my openwrt vm is using sysutils/grub2-bhyve to boot. Thanks for your guide.