网桥的操作:
brctl help
example:
内部虚拟桥添加:
cd /etc/libvirt/qemu/networks/
vim mybr.xml
=================
<network>
<name>mybr</name>
<uuid>a33b5291-4f1a-45bc-9eba-8b3463706652</uuid>
<bridge name="virbr1" />
<forward/>
<ip address="192.168.123.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.123.2" end="192.168.123.254" />
</dhcp>
</ip>
</network>
================
cd /etc/libvirt/qemu/networks/autostart
ln -s ../mybr.xml .
/etc/init.d/libvirtd restart
========随宿主机启动
/etc/init.d/xendomains
cd /etc/xen/auto
ln -s ../vm1 .
当宿主关机的时候,虚拟save.
virsh vcpuinfo vm1
virsh vcpupin vm1
=========
dd if=/dev/zero of=vm1-disk2.img bs=1M seek=2000000 count=1
disk = [ "tap:aio:/var/ftp/xen/vm1.img,xvda,w","tap:aio:/var/ftp/xen/rhel5_c-disk2.img,xvdb,w" ]
========
/etc/libvirt/qemu/networks/virbr1.xml
======
<network>
<name>virbr1</name>
<uuid>d5e9ddc5-0041-434b-824d-5e2134a44af2</uuid>
<bridge name="virbr1" />
<forward/>
<ip address="192.168.222.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.222.2" end="192.168.222.254" />
</dhcp>
</ip>
</network>
======
cd /etc/libvirt/qemu/networks/autostart
ln -s ../virbr1.xml .
/etc/init.d/libvirtd restart
=======================================================
brctl show
brctl addbr xenbr1
brctl addif xenbr1 vif2.0
brctl delif xenbr1 vif2.0
brctl delbr xenbr1