在Ubuntu Xenial客户机中,我无法运行apt-get update
,也无法ping www.google.com
。然后我设置/etc/apt/apt.conf代理设置:
Acquire::http::proxy "http://my.proxy.com:80";
Acquire::https::proxy "https://my.proxy.com:80";
然后我就可以运行apt-get
了。然后我试了
export http_proxy=http://my.proxy.com:80
export https_proxy=https://my.proxy.com:80
但我仍然无法ping www.google.com
。它只是挂起了这条消息
PING www.google.com (74.125.202.105) 56(84) bytes of data.
所以我尝试使用vagrant-proxyconf插件1.5.2版。我在〜/ .vagrant.d / Vagrantfile
中设置了代理设置Vagrant.configure("2") do |config|
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://my.proxy.com:80"
config.proxy.https = "https://my.proxy.com:80"
config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
end
# ... other stuff
end
但我仍然无法ping通www.google.com,无论是export
http_proxy
设置还是取消设置。
我还尝试了一些其他答案的建议,例如
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
和
config.vm.provider 'virtualbox' do |vb|
vb.customize ['modifyvm', :id, '--cableconnected1', 'on']
end
但这一切都无效。有没有人有任何想法?
谢谢!