Follow these step to use the DHCP option:
- You must select dhcp as the value for the type parameter. Within your Vagrantfile, add the following line to enable DHCP private networking:
config.vm.network "private_network", type: "dhcp"
- When you save the Vagrantfile, you can run vagrant up --provision to see the changes:
- To find out the IP address of the newly-upped Vagrant machine, we must SSH into the machine itself.
- Run the vagrant ssh command. Once in the Vagrant machine, run the ifconfig command (this networking command will depend on the operating system). Here is an example output:
- In the enp0s8 section, you can see there is ...