Vagrant Auto-network

Automatically configure Vagrant private network interfaces.


Adding a private network address for vagrant machines generally requires manually entering network interfaces and IP addresses for each machine, and adding or removing machines means updating private network interfaces to make sure that new machines don't collide. Alternately one can run a full blown DHCP server but this is not necessarily portable and requires significant preparation on top of Vagrant.

This plugin registers an internal address range and assigns unique IP addresses for each successive request so that network configuration is entirely hands off. It's much lighter than running a DNS server and masks the underlying work of manually assigning addresses.


Vagrant.configure('2') do |config|
  config.vm.define 'first' do |node| = "centos-5-i386" :private_network, :auto_network => true

  config.vm.define 'second' do |node| = "centos-5-i386" :private_network, :auto_network => true


vagrant plugin install vagrant-auto_network


The default pool range has been hardcoded as '', pending the ability to query the host virtual network adapters for their configuration. To change this, add the following before the Vagrant configuration block:

AutoNetwork.default_pool = ''


If you have questions or concerns about this module, contact finch on Freenode, or email