Skip to content

Instantly share code, notes, and snippets.

@neonstalwart
Created March 26, 2013 16:37
Show Gist options
  • Save neonstalwart/5246908 to your computer and use it in GitHub Desktop.
Save neonstalwart/5246908 to your computer and use it in GitHub Desktop.
this adds some virtualbox support to https://gist.github.com/neonstalwart/5246494
# /etc/pf.conf
scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
nat on { en0 en1 } from 192.168.56.0/24 to any -> { (en0) (en1) }
rdr-anchor "com.apple/*"
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
# hmm... is it possible to get this to work?
#net.inet.ip.forwarding=1
# /usr/local/etc/dnsmasq.d/virtualbox
# virtualbox dhcp and DNS server
listen-address=192.168.56.1
dhcp-range=192.168.56.2,192.168.56.150
dhcp-leasefile=/usr/share/misc/dnsmasq.leases
address=/.dev/192.168.56.1
# WARNING: i still don't have this as automatic as i'd like...
# see https://forums.virtualbox.org/viewtopic.php?f=8&t=47959 more details
# you have to run the following commands
#
# sudo sysctl -w net.inet.ip.forwarding=1
# pfctl -F all -f /etc/pf.conf
# pfctl -e
#
# ...and open a VM to activate the 192.168.56.1 interface :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment