From a99a75a2c7c5d6b717bd1640a14fb6a5f4710257 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Tue, 4 Feb 2014 12:35:13 +1000 Subject: [PATCH] Add documentation on DHCP for private networking --- .../v2/networking/private_network.html.md | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/website/docs/source/v2/networking/private_network.html.md b/website/docs/source/v2/networking/private_network.html.md index b49fc1134..f5729c41b 100644 --- a/website/docs/source/v2/networking/private_network.html.md +++ b/website/docs/source/v2/networking/private_network.html.md @@ -27,11 +27,27 @@ can communicate with each other on private networks.

+## DHCP + +The easiest way to use a private network is to allow the IP to be assigned +via DHCP. + +```ruby +Vagrant.configure("2") do |config| + config.vm.network "private_network", type: :dhcp +end +``` + +This will automatically assign an IP address from the reserved address space. +The IP address can be determined by using `vagrant ssh` to SSH into the +machine and using the appropriate command line tool to find the IP, +such as `ifconfig`. + ## Static IP -The easiest way to use a private network is to assign a static IP to it. -This let's you access the Vagrant managed machine using a static, known -IP. The Vagrantfile for a static IP looks like this: +You can also specify a static IP address for the machine. This lets you +access the Vagrant managed machine using a static, known IP. The +Vagrantfile for a static IP looks like this: ```ruby Vagrant.configure("2") do |config|