Setting a VM's mac address in Vagrant

后端 未结 5 1010
不思量自难忘°
不思量自难忘° 2021-01-31 15:39

The documentation lists that the mac address of a VM can be set in the Vagrantfile, however everything I add seems to end up being a syntax error. Anyone successfully done this?

5条回答
  •  猫巷女王i
    2021-01-31 16:37

    The information provided below is outdated. As per documentation to allow IP to be assigned via DHCP simply use:

    config.vm.network "public_network"
    

    This way you don't need to deal with mac address, it will be generated on its own. If you need custom mac address attached to the network device then:

    config.vm.network "public_network", :mac=> "080027xxxxxx"
    

提交回复
热议问题