Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Support private networking using DHCP #352

Merged
merged 1 commit into from
Apr 6, 2015
Merged

Conversation

ccope
Copy link
Contributor

@ccope ccope commented Mar 9, 2015

Added a type option similar to the way vagrant core does this: http://docs.vagrantup.com/v2/networking/private_network.html. This patch currently depends on a pre-existing dhcp server listening on the bridged network (this was the case after installing the lxc package on Ubuntu). The type option isn't strictly necessary as-is, but would be useful if you want to support starting a dhcp server as needed.

@@ -26,16 +26,19 @@ def configure_private_networks(env)
next if type.to_sym != :private_network

container_name = env[:machine].provider.driver.container_name
address_type = config[:type]
ip = config[:ip]
bridge_ip = config.fetch(:lxc__bridge_ip) { build_bridge_ip(ip) }
bridge = config.fetch(:lxc__bridge_name)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for the double underscore ("lxc__bridge" vs "lxc_bridge") in these variable names? That tripped me up initially.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC this is kinda like the vagrant way of setting "type specific things". Like the rsync__args for the rsync synced folder or linux__nfs_options for NFS synced folders.

HTH

@fgrehm
Copy link
Owner

fgrehm commented Mar 9, 2015

LGTM, I'll make sure this gets merged for the next release. Thanks for the contribution!

fgrehm added a commit that referenced this pull request Apr 6, 2015
Support private networking using DHCP
@fgrehm fgrehm merged commit 55bbade into fgrehm:master Apr 6, 2015
@ccope ccope deleted the private_dhcp branch April 8, 2015 07:48
@fpletz fpletz added this to the v1.2.0 milestone Aug 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants