yashwanth wrote:
Hi,
I have installed xen, kernel-xen , virt-manager and rebooted on xen
kernel.When I do an ifconfig I get details of eth0,eth1,eth2 ,lo and
virbr0.
I have three nics on my host machine.just wanted to emulate three nic
cards on guest also.
brctl show :
bridge name bridge id STP enabled interfaces
eth0 8000.000000000000 no peth0
virbr0 8000.000000000000 yes
for emulating three nics on guest i made changes
to /etc/xen/xend-config.sxp.
in xend-config.sxp file i have just commented out (vif-script
vif-bridge) and added a line (vif-script vif-custom).
Please don't touch (vir-script...) parameter in xen-config.sxp. What you
need is to alter network-bridge as below.
(network-bridge network-bridge-custom)
Keep the vif-script entry as is.
vif-custom script is as follows:
#!/bin/bash
dom=`xenstore-ls|grep -v 0|grep domid|cut -d '"' -f 2`
/etc/xen/scripts/vif-bridge $1 vif=xvif${dom}.0 mac="xx:xx:xx:xx"
bridge=eth0
/etc/xen/scripts/vif-bridge $1 vif=xvif${dom}.1 mac="xx:xx:xx:xx"
bridge=eth0
/etc/xen/scripts/vif-bridge $1 vif=xvif${dom}.2 mac="xx:xx:xx:xx"
bridge=eth0
You need not play with vif-bridge, just network-bridge. This is how I
did this. I had posted this earlier in this list. Just reposting now.
The default xen dom0 configuration creates only a single bridge and the
default guest configuration only creates a single virtual ethernet
interface on the guest. Solution for you would be something below.
- In /etc/sysconfig/network-scripts of dom0 , Configure eth0, eth1 and
eth3 with appropriate network details.
- Edit /etc/xen/xend-config.sxp, comment out Line 91 by putting a # in
the beginning of the line and add the below line after that.
(network-script network-custom)
- Crate /etc/xen/scripts/network-custom with the below contents in it
and give it 755 permission.
#!/bin/bash
/etc/xen/scripts/network-bridge $1 netdev=eth0 bridge=xenbr0 vifnum=0
/etc/xen/scripts/network-bridge $1 netdev=eth1 bridge=xenbr1 vifnum=1
/etc/xen/scripts/network-bridge $1 netdev=eth2 bridge=xenbr2 vifnum=2
- Reboot your system.
- Now you should have xenbr0, xenbr1 and xenbr2 configured properly on
your host system. Run "brctl show" to see details.
Now if you want to start a guest with three virtual interfaces, Edit the
guest configuration file in /etc/xen/<guest name> and change vif=
parameter as below.
vif = [
"mac=00:16:3e:7b:0e:a4,bridge=xenbr0,script=vif-bridge","mac=00:16:3e:7b:0e:a5,bridge=xenbr1,script=vif-bridge"
,"mac=00:16:3e:7b:0e:a6,bridge=xenbr2,script=vif-bridge"]
This would create three virtual ethernet interfaces - eth0, eth1 and
eth2 - in the guest where eth0 would be bridged to xenbr0, eth1 to
xenbr1 and eth2 to xenbr2. Then configure these virtual interfaces in
the guest as you usually do with a physical system. If eth0, eth1 and
eth2 in dom0 are connected to separate subnets and if you configure
these three virtual ethernets in the guest to obtain their ip addresses
from dhcp, then they should have obtained an ip address from the
respective dhcp servers when you restart network service in the guest.
Please make sure that the mac address you assign is unique.
The above vif = entry is for a para-virtualized guest. If it's a fully
virtualized guest, it should be as below.
vif = [ 'type=ioemu, mac=00:16:3e:04:98:04, bridge=xenbr0','type=ioemu,
mac=00:16:3e:04:98:05, bridge=xenbr1','type=ioemu,
mac=00:16:3e:04:98:06, bridge=xenbr2' ]
--Sadique
if i try to create a guest using virt-manager .it gives an error as
"Error:Device 0 (vif) could not be connected. Hotplug scripts not
working."
Please let me know how to proceed..
thanks
yashwanth
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|