VM Tap Networking

= VM Tap Networking =

Most of recent VMs support Linux native tap driver. A simple integration with OpenRC eases the use.

What you get is the following setup:

Host(vbr0) <--+--> (vm0)VM0 |        |    NAT        +--> (vm1)VM1 |  (eth0)

The NAT is optional, if you like you can add eth0 to the bridge and have the VMs accessing the network directly.

Configuration
Add:

To enable NAT to world, see Firewall_Using_Firehol:

Also recommended to install dnsmasq and use host machine as DNS source pf VMs, so VM can always find correct DNS.

If you are using VPN or dynamic interfacing, modify:

qemu settings
Arguments: -net nic,netdev=eth0 -netdev tap,id=eth0,ifname=vm0,script=/bin/true

KVM Arguments: -net nic,netdev=eth0,model=virtio -netdev tap,id=eth0,ifname=vm0,script=/bin/true,vhost=on

Maintainer
Alon Bar-Lev