Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Wrong IP address detection in case of multiple interfaces with private addresses #42

Open
iavael opened this issue Mar 16, 2014 · 2 comments

Comments

@iavael
Copy link

iavael commented Mar 16, 2014

This code in lib/vagrant-chef-zero/env_helpers.rb incorrectly detects address of chef-zero server (it takes address of another interface with private address)

ip_address = Socket.ip_address_list.detect{|intf| intf.ipv4_private?}.ip_address
@electrofelix
Copy link

Essentially it'll take the first match rather than checking for the one matching the network of the provider. This is currently necessary since the chef_server_url must be set before vagrant validates the configuration of any chef_client provisioner steps.

The only solutions appear to be binding to all addresses using '0.0.0.0' (any security concerns?), or insert a dummy url, move the start and upload to after the provider runs and before the provisioner steps, and extract the correct network address to use from the provider.

I've also seen problems with network interface selection and Window's systems with various firewalls (really painful in a corporate env when frequently you can't modify or disable them) where using the machines public interface worked but none of the private ones could be communicated with from within the guest.

@iavael
Copy link
Author

iavael commented Apr 24, 2015

The only solutions appear to be binding to all addresses using '0.0.0.0' (any security concerns?)

I think this is the best variant. People concerned about security of their development/testing environment already have a firewall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants