Re: Qemu, Networking and F7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/1/07, Charles Curley <charlescurley@xxxxxxxxxxxxxxxxx> wrote:
> Has anyone got qemu working on F7 with networking? I've googled and
> read the docs, but nothing I've tried produces a working network.

If you want your host and other hosts to have unfettered access to the
guest, then tap and bridging is the way to go.  I achive this with the
following in /etc/qemu-ifup.  Not sure where I found this originally,
so the credit should go elsewhere, but its been modified a couple of
times so you can credit me with the bugs:

#!/bin/sh
DEV=eth1
/sbin/ifconfig $1 promisc 0.0.0.0
if ! /sbin/ifconfig br0 > /dev/null
then
        /usr/sbin/brctl addbr br0
        /usr/sbin/brctl addif br0 $DEV
        /sbin/ifconfig br0 up
        addr=`/sbin/ip addr | grep $DEV | grep inet | sed -e
's/$DEV/dev br0/' -e s/inet//`
        /sbin/ip addr add $addr
fi
/usr/sbin/brctl addif br0 $1
/usr/sbin/brctl stp br0 off
/sbin/ip route | grep $DEV | while read route
do
    newroute=`echo $route | sed s/$DEV/br0/ `
    /sbin/ip route del $route
    /sbin/ip route add $newroute
done


Make sure you chmod a+x it and set DEV to the NIC that you want to
bridge it with.

You can qemu as follows:

    qemu -net nic -net tap image.img

In your guest OS you'll need to set up the networking.  If you have a
DHCP server on the DEV NIC you're good to go otherwise you'll have to
set up a static IP on the same subnet as the DEV NIC.

The only down side of this is that you need to run qemu as root,
although I am sure that its possible to get round it, I've just never
got round to it.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux