KVM host-internal network

From Phormix Wiki
Jump to: navigation, search

One way to create a host-guest only network is to go through a lot trouble with dummy and bridge interfaces

Alternately, you can create a virtual network that works internally between the host and guests (but not the outside world)

First, create an XML file containing your network definition, e.g. /tmp/kvm-isol.xml This will contain the following info

  • The IP address that the host should assume
  • The DHCP range for addresses available to the guests (note: you can use static IP's as well)
<network>
  <name>isolated</name>
  <ip address='192.168.111.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.111.100' end='192.168.111.150' />
    </dhcp>
  </ip>
</network>
  • Once done, import the XML
virsh net-define kvm-isol.xml
  • You should now be able to start the network and/or set it to autostart
virsh net-start isolated
virsh net-autostart isolated