MacVTap
Jump to navigation
Jump to search
MacVTap is a device driver (type="direct"
) meant to simplify virtualized bridged networking.[1] Typically, this is used in virtualized environments (KVM) to make both the guest and the host show up directly on the switch that the host is connected to and to improve throughput and latencies to external systems. [2]
Example configuration file /etc/libvirt/qemu/
:
<interface type="direct"> <mac address=12:34:56:78:9a:bc/> <source dev=private1 mode=bridge/> <model type=virtio/> <driver name=vhost/> </interface>
The MAC address field is optional, if omitted, the libvirt daemon (libvirtd) will generate a unique MAC address.
Example Virtual Machine using MacVTap driver in mode bridge:
virt-install --autostart --check all=on --name YOUR_VM_MACHINE --memory VM_MEMORY --vcpus VM_CPUs --os-variant ubuntu18.04 --cdrom VM_INSTALLATION_MEDIA --disk /path/libvirt/VM_STORAGE_POOL_NAME/YOUR_VM_MACHINE.qcow2 --noautoconsole --wait TIME_TO_WAIT --network type=direct,source=eno111,source_mode=bridge,model=virtio
error: error creating macvtap interface macvtap0@vnet0 (xx:54:00:7d:1c:xx): Device or resource busy
ifconfig -a macvtap0 macvtap0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 9000 inet6 fe80::5054:ff:feb5:3ef9 prefixlen 64 scopeid 0x20<link> ether 52:54:00:b5:3e:f9 txqueuelen 500 (Ethernet) RX packets 9669 bytes 936225 (936.2 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9271 bytes 2037747 (2.0 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Activities[edit]
- Learn about different MacVTap modes: https://www.ibm.com/support/knowledgecenter/en/linuxonibm/liaag/wkvm/wkvm_c_net_macvtap.htm#fntarg_1
- Learn about MacVtap isolation and limitations https://www.ibm.com/support/knowledgecenter/en/linuxonibm/liaag/wkvm/wkvm_c_net_macvtap.htm#fntarg_1
- Learn about KVM Host Networking Configuration Choices https://www.ibm.com/support/knowledgecenter/en/linuxonibm/liaag/wkvm/wkvm_c_net.htm
- Read Introduction to Linux interfaces for virtual networking https://developers.redhat.com/blog/2018/10/22/introduction-to-linux-interfaces-for-virtual-networking/
- Read about
trustGuestRxFilters
option - Learn about MacVTap and VMware https://unix.stackexchange.com/questions/203926/macvtap-on-vmwares-vm
See also[edit]
- KVM networking, virsh net, MacVTap, Macvtap logs, virtio,
trustGuestRxFilters
- Virsh net: KVM networking,
virsh net-info
,virsh net-define
,virsh net-list
,virsh net-edit
,virsh net-dhcp-leases
,virsh net-start
,virsh net-autostart
,virsh net-list
, KVM networking,/etc/libvirt/qemu/networks/default.xml
, MacVTap
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.
Source: wikiversity
Advertising: