[Top][All Lists]

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

Re: [Qemu-discuss] need help in setting up tap networking for using qemu

From: Chan Kim
Subject: Re: [Qemu-discuss] need help in setting up tap networking for using qemu virtual machine
Date: Thu, 18 Sep 2014 13:08:59 +0000

Forgot to mention that while qemu is running with RTEMS telnetd.exe,  (with 
ETH0IP set to 48)
from the host I get ping response from 47 and 48. But I cannot ping to 
and when I type in the password at telnet, I can get in to both. 
(but couple of times got 'connection close by foreign host.' I remember)
Thanks a lot.
Chan Kim

보낸 사람 : "김찬" <address@hidden>
보낸 날짜 : 2014-09-18 22:00:32 ( +09:00 )
받는 사람 : address@hidden <address@hidden>
참조 : 
제목 : need help in setting up tap networking for using qemu virtual machine

Hello, everyone!

It's good to have some people to ask this.. I really need a help from you and 
this should be a basic question.
I'm trying to run a virtual machine (using qemu-system-sparc, I added lan9220 
emulation model inside) on my CentOS 6.4 machine.
I've read 
 but my case seems different and I am not sure if this previous post is correct 
or not.

My host ip is and I want my virtual machine to be (it's class B network)

I have /etc/qemu-ifup like this

--------------------- start -------------------------
# script to bring up the tun device in QEMU in bridged mode
# first parameter is name of tap device (e.g. tap0)
# some constants specific to the local host - change to suit your host
# guest 132.48 host 132.47 bridge 132.64
set -x
# First take eth0 down, then bring it up with IP address
/sbin/ifdown eth0
/sbin/ifconfig eth0 promisc up
# Bring up the tap device (name specified as first argument, by QEMU)
/usr/sbin/openvpn --mktun --dev $1 --user `id -un`
/sbin/ifconfig $1 promisc up
# create the bridge between eth0 and the tap device
/usr/sbin/brctl addbr br0
/usr/sbin/brctl addif br0 eth0
/usr/sbin/brctl addif br0 $1
# only a single bridge so loops are not possible, turn off spanning tree 
/usr/sbin/brctl stp br0 off
# Bring up the bridge with ETH0IP and add the default route
/sbin/ifconfig br0 $ETH0IP netmask broadcast $BROADCAST
/sbin/route add default gw $GATEWAY
# stop firewall - comment this out if you don't use Firestarter
#/sbin/service firestarter stop
--------------------- end -------------------------

and /etc/qemu-ifdown as

------------------- start --------------------------
# Script to bring down and delete bridge br0 when QEMU exits 
# Bring down eth0 and br0 
set -x
/sbin/ifdown eth0
/sbin/ifdown br0
/sbin/ifconfig br0 down
# Delete the bridge
/usr/sbin/brctl delbr br0
# bring up eth0 in "normal" mode 
/sbin/ifconfig eth0 -promisc
/sbin/ifup eth0
# delete the tap device
/usr/sbin/openvpn --rmtun --dev $1
# start firewall again
#/sbin/service firestarter start 
-------------------- end --------------------------

and I start my virtual machine with this command :

qemu-system-sparc -M ALDEBARAN -serial stdio -kernel 
telnetd/o-optimize/telnetd.exe -net nic -net tap,ifname=tap0
(this makes /etc/qemu-ifup tap0 and /etc/qemu-ifdown tap0 run before and after 
qemu run.)

When I run above command, I can see the virtual machine's code is running. 
(it's RTEMS network-demo program. telnetd.exe)
From outside the host, I can ping to host and the guest. So I thought 
everything is fine But I then I found something is wrong..
When I telnet to, it is centOS as expected.
But when I telnet to, it takes unusually long (like 10 seonds?) 
then I see the loging prompt coming from CentOS.(the host)
I can log into it, and it's my host machine.
(By the way, both telnetting looked hampered by something, like interfering one 
another by wrong setting..)

I can run the same telnetd program using actual board the qemu emulator is 
emulating, and I can telnet to the board (and of course it's RTEMS). Only, when 
using actual board, I use physical network cable between my host and the board. 
(host and the board

I tried setting ETH0IP to in qemu-ifup script but it didn't 

Please anyone tell me what the problem is..

Kind regards, 
Chan Kim

reply via email to

[Prev in Thread] Current Thread [Next in Thread]