Created
September 15, 2013 17:24
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!