我正在尝试启用端口转发,因此我可以从本地计算机访问我的流浪盒,但每当我运行我的流浪盒时,我都会收到此错误,
No base MAC address was specified. This is required for the NAT networking
to work properly (and hence port forwarding, SSH, etc.). Specifying this
MAC address is typically up to the box and box maintainer. Please contact
the relevant person to solve this issue.
但是当我重新运行vagrant up
命令时,它的工作正常,除了我无法从主机上ping它。
我在Vagrantfile
中使用以下行启用端口转发
config.vm.network :forwarded_port, guest: 80, host: 4567
我试图在我的主机上ping它,如下所示,
ping 127.0.0.1:4567
有人可以告诉我如何修复此mac错误问题,以便我可以ping并从本地计算机访问我的盒子?
编辑: 我已经尝试过这段代码来设置MAC地址但它没有做任何事情。
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--macaddress1", "auto"]
end