Ubuntu 20.04.2 LTSにWiFiドングルを設定


こちらを買いました。Linuxで使えるようにするための設定があまり書かれていなかったのでメモ書きを残しておきます。Ubuntu 21でも同様です。

Amazon | TP-Link WiFi 無線LAN 子機 AC600 433Mbps + 200Mbps Windows/Mac OS 対応 ナノ設計 デュアルバンド 3年保証 Archer T2U Nano | TP-LINK | 無線LAN子機 通販
TP-Link WiFi 無線LAN 子機 AC600 433Mbps + 200Mbps Windows/Mac OS 対応 ナノ設計 デュアルバンド 3年保証 Archer T2U Nanoが無線LAN子機ストアでいつでもお買い得。当日お急ぎ便対象商品は、当日お届け可能です。アマゾン配送商品は、通常配送無料(一部除...


matsu@lenovo:~/$ lspci |grep net
08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)
matsu@lenovo:~/$ sudo lshw -c network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:08:00.0
       logical name: eno1
       version: 0e
       serial: 1c:69:7a:4d:00:26
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full ip= latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:30 ioport:f000(size=256) memory:fcd04000-fcd04fff memory:fcd00000-fcd03fff


% git clone https://github.com/aircrack-ng/rtl8812au.git
% cd rtl8812au/
% sudo apt install dkms
matsu@lenovo:~/rtl8812au$ sudo make dkms_install
mkdir -p /usr/src/8812au-
cp -r * /usr/src/8812au-
dkms add -m 8812au -v

Creating symlink /var/lib/dkms/8812au/ ->

DKMS: add completed.
dkms build -m 8812au -v

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
'make' -j8 KVER=5.4.0-90-generic KSRC=/lib/modules/5.4.0-90-generic/build.............
Signing module:
Generating a new Secure Boot signing key:
Can't load /var/lib/shim-signed/mok/.rnd into RNG
139750728316224:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:98:Filename=/var/lib/shim-signed/mok/.rnd
Generating a RSA private key
writing new private key to '/var/lib/shim-signed/mok/MOK.priv'
 - /var/lib/dkms/8812au/
Secure Boot not enabled on this system.
cleaning build area...

DKMS: build completed.
dkms install -m 8812au -v

Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-90-generic/updates/dkms/


DKMS: install completed.
dkms status
8812au,, 5.4.0-90-generic, x86_64: installed
matsu@lenovo:~/rtl8812au$ uname


root@lenovo:/home/matsu/rtl8812au# dkms status
8812au,, 5.4.0-90-generic, x86_64: installed


% dmesg
[ 2098.449336] usb 1-3: USB disconnect, device number 5
[ 2101.243660] usb 1-3: new high-speed USB device number 6 using xhci_hcd
[ 2101.418090] usb 1-3: New USB device found, idVendor=2357, idProduct=011e, bcdDevice= 2.00
[ 2101.418095] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2101.418098] usb 1-3: Product: 802.11ac WLAN Adapter
[ 2101.418100] usb 1-3: Manufacturer: Realtek
[ 2101.418101] usb 1-3: SerialNumber: 00e04c000001
[ 2101.493015] 88XXau: loading out-of-tree module taints kernel.
[ 2101.493536] 88XXau: module verification failed: signature and/or required key missing - tainting kernel
[ 2105.586166] usb 1-3: 88XXau 10:27:f5:09:2e:f7 hw_info[107]
[ 2105.631758] usbcore: registered new interface driver rtl88XXau
[ 2105.671189] rtl88XXau 1-3:1.0 wlx1027f5092ef7: renamed from wlan0
[ 2113.636088] IPv6: ADDRCONF(NETDEV_CHANGE): wlx1027f5092ef7: link becomes ready


root@lenovo:/home/matsu/rtl8812au# nmcli
wlx1027f5092ef7: disconnected
        "TP-Link Wi-Fi"
        wifi (rtl88XXau), 10:27:F5:09:2E:F7, hw, mtu 2312


ip aコマンドで見るとつながっていることがわかります

7: wlx1027f5092ef7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2312 qdisc mq state UP group default qlen 1000
    link/ether 10:27:f5:09:2e:f7 brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic noprefixroute wlx1027f5092ef7
       valid_lft 3552sec preferred_lft 3552sec
    inet6 240f:78:8153:1::2/128 scope global dynamic noprefixroute
       valid_lft 3555sec preferred_lft 1755sec
    inet6 240f:78:8153:1:8f:8b35:3766:78df/64 scope global temporary dynamic
       valid_lft 288sec preferred_lft 288sec
    inet6 240f:78:8153:1:7c53:4137:36ac:2635/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 288sec preferred_lft 288sec
    inet6 fe80::b191:e8c0:2c47:7f85/64 scope link noprefixroute
       valid_lft forever preferred_lft forever