How do I bridge a connection from Wi-Fi to TAP on Mac OS X? (for the emulator QEMU)

Posted by penx on Super User See other posts from Super User or by penx
Published on 2013-05-16T00:59:45Z Indexed on 2014/06/08 21:30 UTC
Read the original article Hit count: 191

Filed under:
|
|
|
|

I'm trying to setup a bridge between my Wi-Fi connection and an emulator (QEMU). I need a virtual machine to be on the same LAN as the host, with its own IP address.

QEMU requires using a TAP (virtual network device) so I have installed tuntaposx, have it running, and can open up QEMU using a TAP:

qemu-system-arm -kernel zImage.integrator -initrd arm_root.img -m 256 -net nic -net tap,ifname=tap1 -nographic -append "console=ttyAMA0" 

I have a script that configures the bridge once QEMU has opened up the TAP interface:

sysctl -w net.link.ether.inet.proxyall=1
sysctl -w net.inet.ip.forwarding=1
sysctl -w net.inet.ip.fw.enable=1
ifconfig bridge0 create
ifconfig bridge0 addm en1
ifconfig tap1 0.0.0.0 up
ifconfig bridge0 addm tap1
ifconfig bridge0 up

If I manually set an IP on the VM, I can ping from the VM to the host, but not from the host to the VM. Also, I can't access the rest of the network from the VM - including not being able to set an IP over DHCP.

Any ideas?

© Super User or respective owner

Related posts about osx

Related posts about networking