1.2 KiB
sidebar_current |
---|
networking-public |
Public Networks
Network identifier: :public_network
Public networks are less private than private networks, and the exact meaning actually varies from provider to provider, hence the ambiguous definition. The idea is that while private networks should never allow the general public access to your machine, public networks can.
Confused? We kind of are, too. It is likely that
public networks will be replaced by :bridged
in a
future release, since that is in general what should be done with
public networks, and providers that don't support bridging generally
don't have any other features that map to public networks either.
DHCP
The easiest way to use a public network is to allow the IP to be assigned via DHCP. In this case, defining a public network is trivially easy:
Vagrant.configure("2") do |config|
config.vm.network :public_network
end
When DHCP is used, the IP can be determined by using vagrant ssh
to
SSH into the machine and using the appropriate command line tool to find
the IP, such as ifconfig
.