From 2d1658895228c67c39dbe681e5956859fbf34299 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 20 Jul 2013 00:43:42 -0400 Subject: [PATCH] Validation so private network IP doesn't end in .1 [GH-1750] --- CHANGELOG.md | 1 + plugins/kernel_v2/config/vm.rb | 4 ++++ templates/locales/en.yml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d9903849..82844e9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ BUG FIXES: error properly if they collide. [GH-1701] - Retry SSH on ENETUNREACH error. [GH-1732] - NFS is silently ignored on Windows. [GH-1748] + - Validation so that private network static IP does not end in ".1" [GH-1750] ## 1.2.4 (July 16, 2013) diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 4e2ea5f20..c2621c6fd 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -407,6 +407,10 @@ module VagrantPlugins errors << I18n.t("vagrant.config.vm.network_ip_required") end end + + if options[:ip] && options[:ip].end_with?(".1") + errors << I18n.t("vagrant.config.vm.network_ip_ends_in_one") + end end end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 29252e576..c43b18a05 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -646,6 +646,9 @@ en: nfs_requires_host: |- Using NFS shared folders requires a host to be specified using `config.vagrant.host`. + network_ip_ends_in_one: |- + Static IPs cannot end in ".1" since that address is always + reserved for the router. Please use another ending. network_ip_required: |- An IP is required for a private network. network_fp_host_not_unique: |-