Installation guide

Chapter 10. Network Configuration
This page provides an introduction to the common networking configurations used by libvirt based
applications. This information applies to all hypervisors, whether Xen, KVM or another. For
additional information consult the lib virt network architecture documentation.
The two common setups are "virtual network" or "shared physical device". The former is identical
across all distributions and available out-of-the-box. The latter needs distribution specific manual
configuration.
Network services on guests are not accessible by default from external hosts. You must enable either
Network Address Translation (NAT) or a network bridge to allow external hosts access to network
services on guests.
10.1. Net work Address T ranslat ion (NAT ) wit h libvirt
One of the most common methods for sharing network connections is to use Network Address
Translation (NAT) forwarding (also know as virtual networks).
Ho st co nf ig u rat io n
Every standard libvirt installation provides NAT based connectivity to virtual machines out of the
box. This is the so called 'default virtual network'. Verify that it is available with the virsh net-list
--all command.
# virsh net-list --all
Name State Autostart
-----------------------------------------
default active yes
If it is missing, the example XML configuration file can be reloaded and activated:
# virsh net-define /usr/share/libvirt/networks/default.xml
The default network is defined from /usr/share/libvirt/networks/default.xml
Mark the default network to automatically start:
# virsh net-autostart default
Network default marked as autostarted
Start the default network:
# virsh net-start default
Network default started
Once the libvirt default network is running, you will see an isolated bridge device. This device
does not have any physical interfaces added, since it uses NAT and IP forwarding to connect to
outside world. Do not add new interfaces.
# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e
136