2015-07-21 64 views
0

我流浪漢文件來訪問主機看起來是這樣的:無法在遊民

Vagrant.configure(2) do |config| 
    config.vm.box = "chef/centos-7.0" 

#cent71 will be the server 
    config.vm.define :cent71 do |cent71| 
    cent71.vm.hostname = "cent71.nv.server" 
    cent71.vm.network :private_network, ip: "192.168.70.101" 
    end 
end 

雖然我能夠在我的主機的網絡瀏覽器訪問192.168.70.101:8080,我無法通過cent71訪問它。 nv.server:8080
我應該改變什麼?

回答

1

你需要添加一個條目到你的主機的/ etc/hosts文件中(假設你使用的是mac或linux機器,不知道如何在windows上做什麼)。

它應該看起來像下面這樣。

## 
# Host Database 
# 
# localhost is used to configure the loopback interface 
# when the system is booting. Do not change this entry. 
## 
127.0.0.1  localhost 
255.255.255.255 broadcasthost 
::1    localhost 

# your mapping right here 
192.168.70.101  cent71.nv.server