我已经建立了一个非常基本的基础设施,其中包含一个工作站,一个opscode托管的厨师服务器和一个流浪的VM节点。
在我的工作站上,我使用了命令vagrant up
.这将下载流浪虚拟机以设置节点。但是,流浪虚拟机节点无法连接到互联网。如何更改 VM 的代理设置?
您可以使用 vagrant-proxyconf 插件:
vagrant plugin install vagrant-proxyconf
然后使用 $HOME/.vagrant.d/Vagrantfile
为所有 VM 配置它。例如:
Vagrant.configure("2") do |config|
config.proxy.http = "http://192.168.0.2:3128/"
config.proxy.https = "http://192.168.0.2:3128/"
# exclude your internal networks, including the Vagrant ones
config.proxy.no_proxy = "localhost,127.0.0.1,192.168.33.*,.example.com"
end