Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

try getting ip in a IPv4/IPv6 environment #160

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/vagrant-parallels/driver/pd_10.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ def read_shared_interface
nat: []
}

# Try IPv4/v6 address style
if info[:ip].nil?
info[:ip] = net_info['Parallels adapter']['IPv4 address']
info[:netmask] = net_info['Parallels adapter']['IPv4 subnet mask']
end

if net_info.key?('DHCPv4 server')
info[:dhcp] = {
ip: net_info['DHCPv4 server']['Server address'],
Expand Down
13 changes: 13 additions & 0 deletions lib/vagrant-parallels/driver/pd_8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,13 @@ def read_host_only_interfaces
info[:bound_to] = net_info['Bound To']
info[:ip] = net_info['Parallels adapter']['IP address']
info[:netmask] = net_info['Parallels adapter']['Subnet mask']

# Try IPv4/v6 address style
if info[:ip].nil?
info[:ip] = net_info['Parallels adapter']['IPv4 address']
info[:netmask] = net_info['Parallels adapter']['IPv4 subnet mask']
end

# Such interfaces are always in 'Up'
info[:status] = "Up"

Expand Down Expand Up @@ -364,6 +371,12 @@ def read_shared_interface
status: "Up"
}

# Try IPv4/v6 address style
if info[:ip].nil?
info[:ip] = net_info['Parallels adapter']['IPv4 address']
info[:netmask] = net_info['Parallels adapter']['IPv4 subnet mask']
end

if net_info.key?('DHCPv4 server')
info[:dhcp] = {
ip: net_info['DHCPv4 server']['Server address'],
Expand Down