qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Is there any approach to setup guest only network
@ 2010-11-16 10:11 郭沐錫
  2010-11-16 11:11 ` Mulyadi Santosa
  0 siblings, 1 reply; 5+ messages in thread
From: 郭沐錫 @ 2010-11-16 10:11 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

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.

Thanks a lot

Best Regards, Sn

[-- Attachment #2: Type: text/html, Size: 577 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Is there any approach to setup guest only network
  2010-11-16 10:11 [Qemu-devel] Is there any approach to setup guest only network 郭沐錫
@ 2010-11-16 11:11 ` Mulyadi Santosa
  2010-11-16 14:40   ` 郭沐錫
  0 siblings, 1 reply; 5+ messages in thread
From: Mulyadi Santosa @ 2010-11-16 11:11 UTC (permalink / raw)
  To: 郭沐錫; +Cc: qemu-devel

On Tue, Nov 16, 2010 at 17:11, 郭沐錫 <maxgreg13625@gmail.com> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Is there any approach to setup guest only network
  2010-11-16 11:11 ` Mulyadi Santosa
@ 2010-11-16 14:40   ` 郭沐錫
  2010-11-16 16:11     ` Mulyadi Santosa
  0 siblings, 1 reply; 5+ messages in thread
From: 郭沐錫 @ 2010-11-16 14:40 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

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 <mulyadi.santosa@gmail.com>

> On Tue, Nov 16, 2010 at 17:11, 郭沐錫 <maxgreg13625@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 3381 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Is there any approach to setup guest only network
  2010-11-16 14:40   ` 郭沐錫
@ 2010-11-16 16:11     ` Mulyadi Santosa
  2010-11-16 18:40       ` 郭沐錫
  0 siblings, 1 reply; 5+ messages in thread
From: Mulyadi Santosa @ 2010-11-16 16:11 UTC (permalink / raw)
  To: 郭沐錫; +Cc: qemu-devel

Hi....

2010/11/16 郭沐錫 <maxgreg13625@gmail.com>:
> 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


to me, the scripts look good...regarding the missing eth, are you sure
it's not there even if you issue "ifconfig -a" command?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Is there any approach to setup guest only network
  2010-11-16 16:11     ` Mulyadi Santosa
@ 2010-11-16 18:40       ` 郭沐錫
  0 siblings, 0 replies; 5+ messages in thread
From: 郭沐錫 @ 2010-11-16 18:40 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

Dear all

Sorry I can't understand what you mean.

I know I still have many things to learn.

Please can you explain more clearly.

Thanks a lot

Best Regards, Sn

2010/11/17 Mulyadi Santosa <mulyadi.santosa@gmail.com>

> Hi....
>
> 2010/11/16 郭沐錫 <maxgreg13625@gmail.com>:
> > 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
>
>
> to me, the scripts look good...regarding the missing eth, are you sure
> it's not there even if you issue "ifconfig -a" command?
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>

[-- Attachment #2: Type: text/html, Size: 1902 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-16 18:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-16 10:11 [Qemu-devel] Is there any approach to setup guest only network 郭沐錫
2010-11-16 11:11 ` Mulyadi Santosa
2010-11-16 14:40   ` 郭沐錫
2010-11-16 16:11     ` Mulyadi Santosa
2010-11-16 18:40       ` 郭沐錫

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).