Setting a VM's mac address in Vagrant

后端 未结 5 997
不思量自难忘°
不思量自难忘° 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条回答
  •  再見小時候
    2021-01-31 16:15

    I used this:

    config.vm.network :bridged , :mac => "080027XXXXXX"
    

    and got what I wanted.

    The docs are unclear on what the syntax for the options hash were, and there seemed to be no example on what this should look like. So, here it is! Bridged with a mac address (edited of course). This brings up eth1 with the mac specified, which makes my DHCP server happy, and gives it a proper fqdn on my network.

提交回复
热议问题