From: "Peter Schütt" <peter_remove_this_@pstt.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Problems with network handling (Bridge, Qemu)
Date: Tue, 13 Jun 2006 07:02:39 -0000 [thread overview]
Message-ID: <e6lnto$ald$1@sea.gmane.org> (raw)
Hallo,
I, Debian Testing/Unstable, 2.6.15, KDE 3.5.3, try to connect my
virtual Qemu-machines totally to my network.
For this I uses scripts which I found at different places.
The start script for the virtual machine:
<win98start.sh>
#!/bin/sh
sudo /opt/qemu/init-kqemu.sh
sudo /opt/qemu/qemu-start-net.sh
qemu -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 -usb -soundhw \
sb16 -localtime win98dev.img $1 $2 $3 $4 $5 $6 $7 $8 $9
</win98start.sh>
The subscripts:
<init-kqemu.sh>
#!/bin/sh
#prepare kqemu
if [ `lsmod | grep -c kqemu` -eq 0 ]; then
echo "load kqemu...";
/sbin/modprobe kqemu major=0;
sleep 3;
fi
/bin/chown root.winuser /dev/kqemu;
/bin/chmod 0660 /dev/kqemu
</init-kqemu.sh>
<qemu-start-net.sh>
#!/bin/sh
if [ `netstat -i | grep -c br0` -eq 0 ]; then
/bin/chgrp winuser /dev/net/tun
/bin/chmod 0664 /dev/net/tun
# Allow IP forwarding
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Setup the bridge";
brctl addbr br0
echo "Add host ethernet adapter to the bridge"
brctl addif br0 eth0
echo "Remove IP address from host ethernet device"
ifconfig eth0 0.0.0.0 up
echo "Grab an IP address from DHCP for the bridge"
/sbin/dhclient br0;
fi;
</qemu-start-net.sh>
The following script will be called by qemu:
<qemu-ifup.sh>
#!/bin/sh
echo $1
/sbin/ifconfig $1 0.0.0.0 promisc up
/usr/sbin/brctl addif br0 $1
</qemu-ifup.sh>
The output of the start script:
[..]
DHCPREQUEST on br0 to 255.255.255.255 port 67
DHCPACK from 192.168.10.1
bound to 192.168.10.22
[..]
It shows that the bridge is connected to the router.
After this neither my host linux machine nor the virtual machine is
connected to the internet.
Also my router was not reachable.
I could solve this only by a restart.
Something I tried to reach the internet again without a restart:
ifconfig br0 down
brctl delif br0 eth0
brctl delbr br0
ifconfig eth0 up
/sbin/dhclient eth0
but it does not work.
I am very appreciate for any hints to solve my problems, also for hints to
reconnect to the internet after failure tries.
Ciao
Peter Schütt
--
www.pstt.de
reply other threads:[~2006-06-13 7:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='e6lnto$ald$1@sea.gmane.org' \
--to=peter_remove_this_@pstt.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).