On Thu, Jul 02, 2009 at 09:40:21PM +0200, Gilles Mocellin wrote: > On Thu, Jul 02, 2009 at 07:31:57PM +0700, Sthu Deus wrote: > > Thank You for Your time and answer, Gilles: > > > > > switch=$(ip route ls | awk '/^default / { for(i=0;i<NF;i++) { if ($(i) > > > == "dev") print $(i+1) }}'| head -n 1) > > > /sbin/ifconfig $1 0.0.0.0 up > > > /usr/sbin/brctl addif ${switch} $1 > > > exit 0 > > > > Could You please echo the variables: $switch and $1 at the moment of a kvm > > run > > start? > > $switch = br0 > $1 = tap0 > > > As mine > > > > ip route ls > > > > returns empty string. > > Here I got : > $ ip route ls > 10.0.0.0/24 dev br0 proto kernel scope link src 10.0.0.1 > default via 10.0.0.4 dev br0 > > Do you really have a network interace ? A default gateway ? > > > Also, have You compiled Yourself kvm-modules from > > kvm-source in order to create the networking? > > No I haven't compiled anything.
I forgot to show my network configuration, especialy my bridge : From /etc/network/interfaces : auto br0 iface br0 inet static address 10.0.0.1 netmask 255.255.255.0 network 10.0.0.0 gateway 10.0.0.4 bridge_ports eth0 bridge_fd 1 bridge_hello 1 bridge_maxage 1 bridge_stp off For the KVM script to work, your main network interface has to be a bridge. Like with XEN.
signature.asc
Description: Digital signature