Skip to content

Instantly share code, notes, and snippets.

@EmbeddedAndroid
Created September 15, 2013 17:24
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save EmbeddedAndroid/6572715 to your computer and use it in GitHub Desktop.
Save EmbeddedAndroid/6572715 to your computer and use it in GitHub Desktop.
Mac OSX (10.8.X) /etc/qemu-ifup script for QEMU/KVM bridged networking.
#!/bin/bash
echo "Executing /etc/qemu-ifup"
echo "Creating bridge"
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
echo "Bringing up $1 for bridged mode"
ifconfig $1 0.0.0.0 up
echo "Add $1 to bridge"
ifconfig bridge0 addm en0 addm $1
echo "Bring up bridge"
ifconfig bridge0 up
@prologic
Copy link

You are a legend! I work with OS X as my main development machine at work and this is exactly what I needed (someone else that's already worked this out!). Thanks heaps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment