我无法从我设置的Vagrant虚拟机中连接到Internet.
例如,在root用户输入时:
curl http://google.com
Run Code Online (Sandbox Code Playgroud)
它失败并显示以下消息:
curl: (6) Couldn't resolve host 'google.com'
Run Code Online (Sandbox Code Playgroud)
我不确定它是否是防火墙设置,但据我所知,我没有为端口80或任何其他端口创建任何防火墙规则.
这是我的Vagrantfile的相关部分.如果我能提供任何其他信息,请在评论中告诉我:
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Let Vagrant manage the hostname at boot
config.vm.hostname = "devbox"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host …Run Code Online (Sandbox Code Playgroud)