From fd644c5105f1741eb96f0761ffee8f8211a68b4d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 10 Jul 2013 20:30:15 -0700 Subject: [PATCH] Forward ports can specify host/guest IP to bind to [GH-1121] --- CHANGELOG.md | 1 + plugins/providers/virtualbox/driver/version_4_0.rb | 4 ++-- plugins/providers/virtualbox/driver/version_4_1.rb | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 868b1fa28..895b4e32e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ IMPROVEMENTS: box exists only backed by one provider. [GH-1032] - `vagrant destroy` returns exit status 1 if any of the confirmations are declined. [GH-923] + - Forwarded ports can specify a host IP and guest IP to bind to. [GH-1121] BUG FIXES: diff --git a/plugins/providers/virtualbox/driver/version_4_0.rb b/plugins/providers/virtualbox/driver/version_4_0.rb index 828d0e1b4..9341a0362 100644 --- a/plugins/providers/virtualbox/driver/version_4_0.rb +++ b/plugins/providers/virtualbox/driver/version_4_0.rb @@ -142,9 +142,9 @@ module VagrantPlugins ports.each do |options| pf_builder = [options[:name], options[:protocol] || "tcp", - "", + options[:hostip] || "", options[:hostport], - "", + options[:guestip] || "", options[:guestport]] args.concat(["--natpf#{options[:adapter] || 1}", diff --git a/plugins/providers/virtualbox/driver/version_4_1.rb b/plugins/providers/virtualbox/driver/version_4_1.rb index c6cb3a6f2..7a648d303 100644 --- a/plugins/providers/virtualbox/driver/version_4_1.rb +++ b/plugins/providers/virtualbox/driver/version_4_1.rb @@ -142,9 +142,9 @@ module VagrantPlugins ports.each do |options| pf_builder = [options[:name], options[:protocol] || "tcp", - "", + options[:hostip] || "", options[:hostport], - "", + options[:guestip] || "", options[:guestport]] args.concat(["--natpf#{options[:adapter] || 1}",