# Question About QEMU Networking

## wswartzendruber

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?

----------

## dreadlorde

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.

```

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

```

----------

## Hu

 *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.
> 
> ```
> 
> 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.

----------

## wswartzendruber

 *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.
> 
> ```
> 
> qemu -hda blah -redir tcp:567::567 -redir tcp:17010::17010 -m 256
> ...

 

Am I right to say that from an IP standpoint, the VM will be on the outside network?

----------

## Dagger

try libvirt. that should solve most of your problems. If it's too heavy, you can always use bridges.

----------

## Hu

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

----------

