How can I define network settings with vagrant

前端 未结 3 707
没有蜡笔的小新
没有蜡笔的小新 2021-02-10 09:02

I am running Ubuntu inside vagrant, here is the Vagrantfile:

# Vagrantfile API/syntax version. Don\'t touch unless you know what you\'re doing!
VAGRANTFILE_API_V         


        
3条回答
  •  醉梦人生
    2021-02-10 10:00

    To change the default NAT you should set it in Vagrantfile.

    For instance:

     config.vm.define "bs" do |bvtserver|
      bvtserver.vm.hostname = "bvt-server"
      bvtserver.vm.network "private_network", ip: "192.168.50.3",
          virtualbox__intnet: "gcptest-network"
      bvtserver.vm.provider :virtualbox do |vbox|
        vbox.customize ["modifyvm", :id, "--natnet1", "10.3/16"]
      end
    end
    

    For credits and more informations: Li Chao blog

提交回复
热议问题