Xen virtualization uses "semi-virtualization" (para-virtualization), all hardware is only scheduled through the Xen hypervisor, compared to VMware Server and workstations to virtual complete hardware device performance is much better! But has always been used when there is a problem: "Virtual network"! Today, I found the latest BATE package for the Virt-manager (RHEL5 GUI tool for managing virtual machines) on RHN. Ha ha.... The virtual network has become simpler from today!
1, download the following package from the Rhn.redhat.com
dnsmasq-2.39-2.el5.i386.rpm
libvirt-0.2.4-4.el5.i386.rpm
libvirt-python-0.2.3-4.el5.i386.rpm
python-virtinst-0.103.0-2.el5.noarch.rpm
virt-manager-0.4.0-2.el5.i386.rpm
#rpm-UVH *.rpm
2. Restart Service
#/etc/init.d/libvirtd restart
#/etc/init.d/xend restart
3. Activate virtual network
First we can see the following files:
/usr/share/libvirt/networks/default.xml
This is the network settings file content for
<network>
<name>default</name>
<bridge name="virbr0" />
<forward/>
<ip address="192.168.122.1" netmask="255.255.255.0"> //虚拟网卡的IP
<dhcp>
<range start="192.168.122.2" end="192.168.122.254" /> //DHCP要分配的地址
</dhcp>
</ip>
</network>
Using Virsh to manage virtual networks
#virsh
Virsh # Net-create/usr/share/libvirt/networks/default.xml
Virsh # Net-start Default
Virsh # Quit
#ifconfig
At this point you should see a new NIC Virbr0
4, the establishment of a new virtual network segment
#cp /usr/share/libvirt/networks/default.xml /usr/share/libvirt/networks/mynet.xml
#vim /usr/share/libvirt/networks/mynet.xml
<network>
<name>mynet</name>
<bridge name="virbr1" />
<forward/>
<ip address="172.16.122.1" netmask="255.255.255.0"> //虚拟网卡的IP
<dhcp>
<range start="172.16.122.2" end="172.16.122.254" /> //DHCP要分配的地址
</dhcp>
</ip>
</network>
Using Virsh to manage virtual networks
#virsh
Virsh # Net-create/usr/share/libvirt/networks/mynet.xml
Virsh # Net-start MyNet
Virsh # Quit
#ifconfig
At this point you should see a new NIC Virbr1
=================================================