Preventing IP's ending in .1 is incorrect! #2868
Comments
|
Fixed in git, this is a warning now! |
mitchellh
closed this
Feb 3, 2014
|
@mitchellh Can you reference the git commit? If it's just a warning, then this bug should still be open. Vagrant shouldn't warn there is a problem if it's easily detectable and ignored. |
|
Here it is: ac43985 I can't detect whether .1 is available because it is provider-specific (VirtualBox/VMware have different router addresses) and so on. I think a warning does a good job here. |
|
@mitchellh I see, good point. Okay, well if you can figure out/recommend the rough sketch of how this should be implemented in each provider, I can at least have a go at patching it for vagrant-libvirt. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
purpleidea commentedJan 21, 2014
For a network like: 10.10.0.0/16 the first (router) address is: 10.10.0.1 however there are many other valid addresses like: 10.10.42.1 which shouldn't be reserved for the router. As a result, if you're using a valid address, it could get rejected if it ends with .1
The bug is in: plugins/kernel_v2/config/vm.rb
if options[:ip] && options[:ip].end_with?(".1") errors << I18n.t("vagrant.config.vm.network_ip_ends_in_one") endThe real solution is to check that this isn't the first address. If you can tell me how to get the CIDR or netmask variable in this file, I'll write the patch. The correct logic to find the router address can be seen here:
https://github.com/purpleidea/puppet-gluster/blob/master/vagrant/gluster/Vagrantfile#L51
Cheers,
James