Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question About QEMU Networking
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Thu Feb 11, 2010 4:23 am    Post subject: Question About QEMU Networking Reply with quote

I want to bind a VM to a physical ethernet device. From what I can tell, I create a TAP device and bridge it with the NIC. Then I tell QEMU to bind to the TAP. Is this anywhere near right?
_________________
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Back to top
View user's profile Send private message
dreadlorde
Apprentice
Apprentice


Joined: 16 Dec 2008
Posts: 243
Location: /adm/timezone/US_Michigan

PostPosted: Thu Feb 11, 2010 12:36 pm    Post subject: Reply with quote

When I used Qemu with Plan 9 I used this to get networking. I see no reason why it wouldn't work with other OS's.
Code:

qemu -hda blah -redir tcp:567::567 -redir tcp:17010::17010 -m 256

_________________
Ludwig von Mises Institute
Quote:
I am not to be a shepherd, I am not to be a grave-digger. No longer will I speak to the people; for the last time I have spoken to the dead.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15995

PostPosted: Fri Feb 12, 2010 3:22 am    Post subject: Reply with quote

dreadlorde wrote:
When I used Qemu with Plan 9 I used this to get networking. I see no reason why it wouldn't work with other OS's.
Code:

qemu -hda blah -redir tcp:567::567 -redir tcp:17010::17010 -m 256
That may work, but it is likely to be slower than using a TAP based NIC, since the command shown relies on the Qemu usermode stack.

Bridging the TAP device to the physical card, as described by the original poster, will allow the guest to interact with the physical network, including seeing arp traffic and negotiating DHCP with a server not on the host machine.
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Fri Feb 12, 2010 7:04 am    Post subject: Reply with quote

Hu wrote:
dreadlorde wrote:
When I used Qemu with Plan 9 I used this to get networking. I see no reason why it wouldn't work with other OS's.
Code:

qemu -hda blah -redir tcp:567::567 -redir tcp:17010::17010 -m 256
That may work, but it is likely to be slower than using a TAP based NIC, since the command shown relies on the Qemu usermode stack.

Bridging the TAP device to the physical card, as described by the original poster, will allow the guest to interact with the physical network, including seeing arp traffic and negotiating DHCP with a server not on the host machine.

Am I right to say that from an IP standpoint, the VM will be on the outside network?
_________________
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Back to top
View user's profile Send private message
Dagger
Retired Dev
Retired Dev


Joined: 11 Jun 2003
Posts: 765
Location: UK

PostPosted: Fri Feb 12, 2010 12:02 pm    Post subject: Reply with quote

try libvirt. that should solve most of your problems. If it's too heavy, you can always use bridges.
_________________
95% of all computer errors occur between chair and keyboard (TM)
Join the FSF as an Associate Member!
Post under CC license.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15995

PostPosted: Sat Feb 13, 2010 3:48 am    Post subject: Reply with quote

wswartzendruber wrote:
Am I right to say that from an IP standpoint, the VM will be on the outside network?
Yes. If you would prefer to isolate the VM, you could skip the bridge and instead configure your host as a NAT device to NAT traffic coming from the TAP device to the real world.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum