Skip to content

Commit

Permalink
Issue geerlingguy#185: Added ability for configuring a public network.
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Aschbrenner authored and ravbaba committed Sep 23, 2015
1 parent 9ac84fb commit f03ad58
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
else
config.vm.network :private_network, ip: vconfig['vagrant_ip']
end

if vconfig['vagrant_enable_public_network']
if vconfig['vagrant_public_ip'] == "0.0.0.0"
config.vm.network :public_network
else
config.vm.network :public_network, ip: vconfig['vagrant_public_ip']
end
end

config.ssh.insert_key = false
config.ssh.forward_agent = true

Expand Down
9 changes: 9 additions & 0 deletions example.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ vagrant_hostname: drupalvm.dev
vagrant_machine_name: drupalvm
vagrant_ip: 192.168.88.88

# If you need to access this guest from a device other than the host you will
# want to enable public networking. Optionally provide a static IP value.
# Warning! Vagrant boxes are insecure by default and by design, featuring public
# passwords, insecure keypairs for SSH access, and potentially allow root access
# over SSH.
# https://docs.vagrantup.com/v2/networking/public_network.html
vagrant_enable_public_network: false
# vagrant_public_ip: 192.168.1.100

# A list of synced folders, with the keys 'local_path', 'destination', 'id', and
# a 'type' of [nfs|rsync|smb] (leave empty for slow native shares). See
# http://docs.drupalvm.com/en/latest/extras/syncing-folders/ for more info.
Expand Down

0 comments on commit f03ad58

Please sign in to comment.