I've been trying all day to get a public network setup using Vagrant 1.6.5 with VirtualBox. I really need to be able to access all my Homestead sites on my other devices (iPad, iPhone, Android phone, etc.) on my local network. The box provisions fine but the sites all timeout.
homestead.rb
config.vm.network "public_network", :bridge => "en0: Wi-Fi (AirPort)", :ip => "192.168.1.200"
My host is OS X mavericks using DHCP (192.168.1.137
).
Private networking works fine, but I can't get public networking to work with any variation of the above config.
You can just grab the host's internal IP address (NOT the VM ip) and add the port :8000
. Let's say your host ip is 192.168.0.5, then from any other device on your network, you can just browse to the host at 192.168.0.5:8000
and you'll hit the VM and see the Laravel home page.
This works great for me with the default homestead.rb setting:
# Configure A Private Network IP
config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"
To get my homestead machine to be visible from my LAN I did the following:
Edit the Homestead/scripts/homestead.rb
file and set config.vm.network :public_network, ip: "192.168.1.123"
(just make sure the IP is free).
Do a vagrant reload
Make sure my old local hosts
file now points to the new IP.
The result is I can ping 192.168.1.123
from another machine in my LAN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With