GNS3 中的 QEMU 参数无效 'vlan'

Invalid parameter 'vlan' with QEMU in GNS3

我是 GNS3 和 qemu 的新手,需要使用这个工具。
我需要使用现有的项目 GNS3 但 QEMU 有问题。

当我尝试启动 GNS3 项目时收到此错误:

QEMU process has stopped, return code: 1
Start QEMU with /usr/bin/qemu-system-x86_64 -name Bob -m 256M -smp cpus=1 -enable-kvm -machine smm=off -boot order=c -drive file=/home/name/GNS3/projects/LabCybersecurity/project-files/qemu/c38ee3b0-8557-4d69-b9ce-318fdd23810a/hda_disk.qcow2,if=ide,index=0,media=disk -uuid c38ee3b0-8557-4d69-b9ce-318fdd23810a -serial telnet:127.0.0.1:5006,server,nowait -monitor tcp:127.0.0.1:44319,server,nowait -net none -net nic,vlan=0,macaddr=00:4c:72:81:0a:00,model=e1000 -net socket,vlan=0,name=gns3-0,udp=127.0.0.1:10065,localaddr=127.0.0.1:10064 -vga none -vnc none

Execution log:
qemu-system-x86_64: Invalid parameter 'vlan'

如何解决这个问题?

-net 的 "vlan" 参数在 QEMU 2.9.0 中已弃用,并在后续版本中删除。您需要更新命令行才能使用它。以下是有关此弃用的手册文本:

The "-net vlan=NN" argument was mostly used to attach separate network backends to different virtual NICs. This is the default behavior for "-netdev" and "-nic". You can connect multiple "-netdev" and "-nic" devices to the same network using the "hubport" network backend, created with "-netdev hubport,hubid=NN,..." and "-nic hubport,hubid=NN".

因此,根据您要执行的操作,您可能只想删除 vlan 参数,或者将其替换为涉及 hubports 的参数。