尝试在 KVM 上的来宾 VM 之间使用 veth 对。
已经在 linux 上创建了 Veth pair,并且能够在一个上注入流量并在另一个上接收。
在 KVM 中使用 VM 进行测试需要您的建议。找出添加 virsh 转储 xml 的方法。
尝试更新xml
virsh dumpxml NEv1_cc1 > NEv1_cc1_aftstartdumpxml.txt
NEv1_cc1_aftstartdumpxml.txt
...
<interface type='direct'>
<mac address='52:54:00:a1:1c:40'/>
<source bridge='138_craft'/>
<target dev='v1'/>
<model type='e1000'/>
<alias name='net8'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x7'/>
</interface>
...
得到错误:
santoshk@kvmserver:~$ virsh define NEv1_cc1_aftstartdumpxml.txt
error: Failed to define domain from NEv1_cc1_aftstartdumpxml.txt
error: internal error: No <source> 'dev' attribute specified with <interface type='direct'/>
我试图遵循以下水龙头/桥的类似线路
<interface type='bridge'>
<mac address='52:54:00:a1:1c:43'/>
<source bridge='138_craft'/>
<target dev='tap391'/>
<model type='e1000'/>
<alias name='net7'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x7'/>
</interface>
主机上的 veth 对:
ip link
26469: v1@v2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether ea:5e:62:9b:71:91 brd ff:ff:ff:ff:ff:ff
26468: v2@v1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 0e:97:c6:fb:f4:47 brd ff:ff:ff:ff:ff:ff
santoshk@kvmserver:~$ ifconfig v1
v1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::e85e:62ff:fe9b:7191 prefixlen 64 scopeid 0x20<link>
ether ea:5e:62:9b:71:91 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 42 bytes 3012 (2.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
santoshk@kvmserver:~$ ifconfig v2
v2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::c97:c6ff:fefb:f447 prefixlen 64 scopeid 0x20<link>
ether 0e:97:c6:fb:f4:47 txqueuelen 1000 (Ethernet)
RX packets 42 bytes 3012 (2.9 KiB)
RX errors 0 dropped 26 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0