<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 09/20/2018 04:52 AM, Frank Wang
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:150a63ab.9662.165f62e41a3.Coremail.wangpeihuixyz@126.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div
style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial">
<div>Hi All,</div>
<div><br>
</div>
<div>I'd like to know what determines the type of virtual NIC in
libvirt ? There was a problem I encountered, the vm can't get
the mirror traffic while the virtual port in openvswitch is
veth, If the virtual port is tun, the everything is fine.</div>
<div><br>
</div>
<div>[root@allinone-247 ~]# ethtool -i vn62f717800<br>
driver: veth<br>
version: 1.0<br>
firmware-version: <br>
expansion-rom-version: <br>
bus-info: <br>
supports-statistics: yes<br>
supports-test: no<br>
supports-eeprom-access: no<br>
supports-register-dump: no<br>
supports-priv-flags: no</div>
<div><br>
</div>
<div>I uninstall the veth kernel module, then restart vm, then
the vm can receive the mirror traffic</div>
<div><br>
</div>
<div>[root@allinone-247 ~]# ethtool -i vn62f717800<br>
driver: tun<br>
version: 1.6<br>
firmware-version: <br>
expansion-rom-version: <br>
bus-info: tap<br>
supports-statistics: no<br>
supports-test: no<br>
supports-eeprom-access: no<br>
supports-register-dump: no<br>
supports-priv-flags: no<br>
</div>
<div><br>
</div>
<div>so, I'm wondering if there are configuration options which
can be configured to use which type of virtual NIC(tap or
veth).</div>
<div><br>
</div>
<div>Any comments would be appreciate.<br>
</div>
</div>
</blockquote>
<br>
From IRC, here is the <interface> you posted:<br>
<br>
<interface type="bridge"><br>
<mac address="00:16:3e:73:30:07"/><br>
<source bridge="managevSwitch"/><br>
<vlan><br>
<tag id="0"/><br>
</vlan><br>
<virtualport type="openvswitch"><br>
<parameters
interfaceid="8a344c7762a32b2d0162db9d09f42efa"/><br>
</virtualport><br>
<target dev="vnfa3b798b1"/><br>
<model type="virtio"/><br>
<address type="pci" domain="0x0000" bus="0x0"
function="0x0" slot="0x11"/><br>
</interface><br>
<br>
<br>
If you are creating a qemu/kvm virtual machine, the above interface
config will *always* get you a tap device, and if you are creating
an LXC virtual machine it will always get you a veth device. This is
a necessity of the way the two technologies expose the network
device in the guest; if you are getting a veth device for use with
qemu/kvm, or a tap device for use with LXC, then there is something
going on that I don't understand.<br>
</body>
</html>