Disable internet (external access) on Vagrant VM

Viewed 928

I'm trying to simulate a production environment using my local computer with the help of Vagrant. The VM was not supposed to have any access to the internet.

Tried to untick the "Cable Connected" on the VirtualBox settings, but I will not be able to SSH to the VM which defeat the purpose.

Vagrantfile:

config.vm.define "second" do |second|
  second.vm.box = "centos/7"
  second.vm.box_check_update = false
  second.vm.hostname = 'second'

  second.vm.network :private_network, ip: "111.111.11.111"

  second.vm.provider :virtualbox do |v|
    v.name = "second"
  end

  second.vm.synced_folder "/devdir", "/vagrant_data"
end

Verification:

curl www.google.com  ## This should return error/ cannot found?

Thanks in advance, people!

0 Answers
Related