HOWTO: kvm with vde networking on Ubuntu, Debian et cetera
As discussed in a previous article, KVM is a kernel-accelerated virtualization package for Linux that utilizes AMD or Intel VT to reduce the cost of virtualization. It is based in part on qemu, a long-lived processor emulation package which also has a non-VT virtualizing engine, kqemu. One of the benefits of using qemu as a codebase is that qemu already has emulation for various pieces of hardware, including network cards. qemu can use a variety of methods for providing networking, including slirp, tunneling, and various others.
To me, the most interesting type of networking is VDE, or "virtual distributed ethernet". This is most similar to the type of networking performed by VMware. vde provides virtual switches (or hubs) and lets you connect them together at will. This document will not explain how to configure a complicated setup; it explains only how to set up a single TUN/TAP interface and utilize it. I will also briefly cover IP Masquerading, which is necessary for your system to access the outside world if it doesn't have a real, routable IP address.