All usb devices have support for recording the usb traffic. This can be enabled using the pcap=<file> property, for example:
-device usb-mouse,pcap=mouse.pcap
于是赶紧去看 Proxmox VE 的 USB 选项,配置之后,可以正常发现设备,虚拟机里的软件也能正常识别。
ssh 到 pve 宿主机上,我的虚拟机 ID 102
qm showcmd 102
去掉 USB 再来一次,对比了一下命令参数,和 pve 的文档一致 https://pve.proxmox.com/wiki/USB_Devices_in_Virtual_Machines
root@pve:~# qm monitor 102
Entering QEMU Monitor for VM 102 - type 'help' for help
qm> device_add qemu-xhci,p2=15,p3=15,id=xhci,bus=pci.1,addr=0x1b
qm> device_add usb-host,bus=xhci.0,port=1,vendorid=0xXXXX,productid=0xXXXX,id=usb0,pcap=/tmp/esXXXX.pcap
qm> quit
流量转给一个 point-to-point 设备,例如 wireguard、sit tunnel,OpenVPN TUN等,或者 OpenVPN TAP 类似的 二层设备
例如,全部流量转给 wireguard wg0,table 33
ip route add 172.16.55.0/24 dev dns0 table 33
ip rule add from 172.16.55.0/24 table 33
ip route add default dev wg0 table 33
iptables -t nat -A POSTROUTING -s 172.16.55.0/24 -o wg0 -j MASQUERADE
> python3.10 proxy.py
Traceback (most recent call last):
File "\proxy\proxy.py", line 11, in <module>
server_context.load_cert_chain('../../docs/cert.pem', '../../docs/cert.key')
ssl.SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:3874)