Skip to content

Commit

Permalink
Merge pull request #1945 from znz/fix/master/forwarded_port-guest_ip
Browse files Browse the repository at this point in the history
pass guest_ip option from config to driver [GH-1121]
  • Loading branch information
mitchellh committed Jul 18, 2013
2 parents 6eaeb96 + 8890676 commit d3993bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/providers/virtualbox/action/forward_ports.rb
Expand Up @@ -69,6 +69,7 @@ def forward_ports
# Add the options to the ports array to send to the driver later
ports << {
:adapter => fp.adapter,
:guestip => fp.guest_ip,
:guestport => fp.guest_port,
:hostip => fp.host_ip,
:hostport => fp.host_port,
Expand Down
6 changes: 6 additions & 0 deletions plugins/providers/virtualbox/model/forwarded_port.rb
Expand Up @@ -24,6 +24,11 @@ class ForwardedPort
# @return [String]
attr_reader :protocol

# The IP that the forwarded port will connect to on the guest machine.
#
# @return [String]
attr_reader :guest_ip

# The port on the guest to be exposed on the host.
#
# @return [Integer]
Expand All @@ -48,6 +53,7 @@ def initialize(id, host_port, guest_port, options)
@auto_correct = true
@auto_correct = options[:auto_correct] if options.has_key?(:auto_correct)
@adapter = (options[:adapter] || 1).to_i
@guest_ip = options[:guest_ip] || nil
@host_ip = options[:host_ip] || nil
@protocol = options[:protocol] || "tcp"
end
Expand Down

0 comments on commit d3993bb

Please sign in to comment.