Vagrant不遵守Vagrant文件中的静态ip定义
流浪版本:2.2.5 提供商:Hyper-V 操作系统:Windows101809 在我的vagrant文件中指定ipv4地址时,在使用“vagrant up”时,它不会分配该地址,而是分配另一个地址 我尝试过将地址更改为不同的范围,使用不同的适配器等,但它仍然不符合Vagrant文件中指定的内容 流浪者档案:Vagrant不遵守Vagrant文件中的静态ip定义,vagrant,vagrantfile,vagrant-windows,Vagrant,Vagrantfile,Vagrant Windows,流浪版本:2.2.5 提供商:Hyper-V 操作系统:Windows101809 在我的vagrant文件中指定ipv4地址时,在使用“vagrant up”时,它不会分配该地址,而是分配另一个地址 我尝试过将地址更改为不同的范围,使用不同的适配器等,但它仍然不符合Vagrant文件中指定的内容 流浪者档案: Vagrant.configure("2") do |config| config.vm.define "kube-1" do |ctl| ctl.vm.box
Vagrant.configure("2") do |config|
config.vm.define "kube-1" do |ctl|
ctl.vm.box = "generic/ubuntu1804"
ctl.vm.hostname = "kube-1"
ctl.vm.network "private_network", ip: "172.18.72.210", bridge: "Default Switch"
ctl.vm.synced_folder ".", "/vagrant", disabled: true
ctl.vm.provider "hyperv" do |vb|
vb.memory = 2048
vb.cpus = 2
end
end
end
输出:
Bringing machine 'kube-1' up with 'hyperv' provider...
==> kube-1: Verifying Hyper-V is enabled...
==> kube-1: Verifying Hyper-V is accessible...
==> kube-1: Importing a Hyper-V instance
kube-1: Creating and registering the VM...
kube-1: Successfully imported VM
kube-1: Configuring the VM...
==> kube-1: Starting the machine...
==> kube-1: Waiting for the machine to report its IP address...
kube-1: Timeout: 120 seconds
kube-1: IP: 172.18.72.197
==> kube-1: Waiting for machine to boot. This may take a few minutes...
kube-1: SSH address: 172.18.72.197:22
kube-1: SSH username: vagrant
kube-1: SSH auth method: private key
kube-1: Warning: Remote connection disconnect. Retrying...
kube-1:
kube-1: Vagrant insecure key detected. Vagrant will automatically replace
kube-1: this with a newly generated keypair for better security.
kube-1:
kube-1: Inserting generated public key within guest...
kube-1: Removing insecure key from the guest if it's present...
kube-1: Key inserted! Disconnecting and reconnecting using new SSH key...
==> kube-1: Machine booted and ready!
==> kube-1: Setting hostname...
我希望它查看Vagrant文件(根据文档)并分配我指定的IP地址,即使它与现有范围重叠(根据文档建议!)
我从来没有遇到过流浪汉的问题,但话说回来,我从来没有需要静态分配地址。。。唉
如果您能帮助调查/解释发生了什么,我们将不胜感激 ip:“172.18.72.210”是一个公共ip-您需要从中选择一个ip,也许您想设置为
172.16.72.210我相信分配给私有ip地址空间的172.16.0.0/12涵盖了我正在使用的范围,172.18.72.x,所以不确定是这个范围!IP地址172.17.72.210由AT&T Services,Inc.提供,属于CDIR(无类别域间路由)172.0.0.0/12(范围172.0.0.0至172.15.255.255)。是否与