On Tue, Jan 24, 2012 at 1:40 PM, Bruce Dubbs <[email protected]> wrote: > Nathan Coulson wrote: > >> Not any time to proofread this, but this is what I use >> >> echo > /etc/qemu-ifup << "EOF" >> ip addr add 0.0.0.0 dev $1 >> ip link set $1 up >> brctl addif br0 $1 >> EOF > > Nathan, this is exactly what I need. In the above, do you need > > brctl addbr br0 > > or is qemu supposed to do that for you? My client right now is Fedora > and there is no br0 present.
It has to exist first. Qemu creates that tap0 [again, I could have the name wrong]. It is up to the /etc/qemu-if on what to do with that interface. I bridged it into br0 which I setup using the LFS network bootscripts. See ifconfig.br0-0 >> I also attached my bridge script, which was upgraded to the new system >> (I still had boot_mesg in there though [cosmetic], but I did a quick >> fix on that. Untested) >> >> cat > /etc/sysconfig/ifconfig.br0-0 << "EOF" >> IFACE=br0 >> ONBOOT=yes >> CHECK_LINK=no >> SERVICE=bridge >> INTERFACES=eth0 >> EOF > > When I run the following on the host > > brctl addbr br0 > ip addr add 0.0.0.0 dev br0 > ip link set br0 up > brctl addif br0 eth0 > > That last command kills my normal eth0 connection. I had to reboot to > get it back. br0, should act like a hardware switch does, where eth0 is one of the ports. (Basically, we made a 1 port switch). After br0 is created, then you can setup an IP Address on br0 (instead of eth0). The ifconfig.br0-1 file, is what I used to give br0 an IP Address. there is no ifconfig.eth0 file on my computer >> qemu-system-x86_64 -net nic -net tap >> >> will create a new tap0, calls /etc/qemu-ifup tap0, which I proceed >> to dump into my br0 (disclaimer: not sure if I mean tun or tap) > > When I run qemu-system-x86_64 -net nic -net tap, I get > > /etc/qemu-ifup: could not launch network script > > the script is present and executable. > > but if I say -net tap,script=no, I get the GRUB prompt and it will boot. > I do have at that point a tap0 device on the host. > > Any ideas? script=no, tells qemu not to run /etc/qemu-ifup, (and it is executable) I had a #!/bin/bash in the top of mine (and some comments I left out in my original thread). Maybe that's what it is looking for. Or possibly there is a failure in the script. Could add a few &> /tmp/log.txt on the end of each line > -- Bruce > -- Disclaimer: I am not a bridging expert, forgive me if the way I describe it as working is completely wrong -- Nathan Coulson (conathan) ------ Location: British Columbia, Canada Timezone: PST (-8) Webpage: http://www.nathancoulson.com -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
