From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVETO-0005uS-Eq for qemu-devel@nongnu.org; Tue, 10 Mar 2015 03:21:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVETK-0003lq-FP for qemu-devel@nongnu.org; Tue, 10 Mar 2015 03:21:02 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:25486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVETJ-0003jB-OK for qemu-devel@nongnu.org; Tue, 10 Mar 2015 03:20:58 -0400 Message-ID: <54FE9B4C.9040100@huawei.com> Date: Tue, 10 Mar 2015 15:20:44 +0800 From: Gonglei MIME-Version: 1.0 References: <54FE901B.5040208@huawei.com> In-Reply-To: <54FE901B.5040208@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Using tap device for qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao , Gayathri Nagarajan , qemu-devel@nongnu.org On 2015/3/10 14:32, Shannon Zhao wrote: > On 2015/3/10 12:59, Gayathri Nagarajan wrote: >> I have a problem with networking in qemu. I want to use the Linux tap device for qemu network. For that >> >> *1. I created a bridge -* >> >> $ sudo brctl addbr br0 >> >> *2. I used the following qemu-ifup script* >> >> #!/bin/sh >> set -x >> >> switch=br0 >> >> if [ -n "$1" ];then >> /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1 >> /usr/bin/sudo /sbin/ip link set $1 up >> sleep 0.5s >> /usr/bin/sudo /usr/sbin/brctl addif $switch $1 >> exit 0 >> else >> echo "Error: no interface specified" >> exit 1 >> fi >> >> *3. When I run qemu using* >> >> $ qemu-system-i386 -m 200M -cdrom images/ss.iso -serial stdio -device e1000,netdev=net0,mac=DE:AD:BE:EF:00:C0 -netdev tap,id=net0,script=/home/user/qemu-ifup >> >> */home/user/qemu-ifup:could not launch network script* >> > > Please check whether qemu-ifup exits at this directory and qemu-ifup has executable permission. > Yes, the script has to have executable permission. Regards, -Gonglei >> *qemu-system-i386: -netdev tap,id=net0,script=/home/user/qemu-ifup: Device 'tap' could not be initialized* >> >> >> How do I resolve this problem? >> >> Thank you >> >> gayathri >> >> > >