qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Is there any approach to setup guest only network


From: 郭沐錫
Subject: Re: [Qemu-devel] Is there any approach to setup guest only network
Date: Tue, 16 Nov 2010 22:40:39 +0800

Dear all

I have set two directory for QEMU.

One of my qemu-ifup is as follow(the other ip address is different)

#!/bin/sh
sudo modprobe tun
sudo /sbin/ifconfig $1 up 192.168.2.52 netmask 255.255.255.0 broadcast 192.168.2.255
 
# IP masquerade
sudo echo "1" > /proc/sys/net/ipv4/ip_forward
sudo /sbin/iptables -N nat
sudo /sbin/iptables -t nat -F
sudo /sbin/iptables -t nat -A POSTROUTING -s 192.168.2.62 -j MASQUERADE
sudo /sbin/iptables -t nat -A POSTROUTING -d 192.168.2.62 -o $1

As the QEMU start, I would key in two instructions

ifconfig eth0 192.168.2.62
route add default gw 192.168.2.52

In the case of mac address, I have found that two QEMU use the same mac address.

However, when I try to assign another mac address to second QEMU.

sudo /home/sn/qemu/qemu-0.12.5/install_gcc/bin/qemu-system-arm -M versatilepb -monitor stdio -kernel vmlinuz-2.6.26-2-versatile -initrd initrd.img-2.6.26-2-versatile -hda test.img -append "root=/dev/sda1" -net nic,macaddr=52:54:00:12:34:57 -net tap,script=./qemu-ifup

The eth0 will disappear like this

http://myweb.ncku.edu.tw/~p76991028/eth0.png

I can't realize why this would happen.

Please tell me where I was wrong.

2010/11/16 Mulyadi Santosa <address@hidden>
On Tue, Nov 16, 2010 at 17:11, 郭沐錫 <address@hidden> wrote:
> Dear all
> I have run QEMU with debian
> I can use TUN/TAP to connect the internet or host when single QEMU
> However when I run two QEMU with two qemu-ifup and different address (on the
> same host) at the same time, the second QEMU cannot connect to host...
> Is there are any approach to setup guest only network.
> Because I want to run ssh among the QEMUs on the same host.

Try to paste your complete command together with the parameters you
used in this list. Hopefully then we could analyze it.

PS: have you assigned different mac address on both guests?

--
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com


reply via email to

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