Static IP's for networks without dhcp, what are the options?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Static IP's for networks without dhcp, what are the options?

James Kyle
Is it possible to declare what ip a vagrant guest will have?

I only see a few options for this in vagrant

private_network
hostonly network
bridged

When using the vmware plugin (ran into similar problems with virtualbox as well). The private_network and hostonly create or attach to networks with dhcp servers running. If the dhcp server is disabled, vagrant loses the ability to interact with the guest vms for vagrant ssh, mounting drives, and provisioning.

In certain network models, having the host provide dhcp is a deal breaker. For example, when modeling bare metal orchestration using pxe servers or testing dhcp deploys themselves. 

I can't find any option for telling vagrant what the guest IP will be in these situations. Am I just missing it?

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Static IP's for networks without dhcp, what are the options?

VMTrooper
Hello James,

For private (hostonly) networks, the process is simple.  Here is sample code:
controller.vm.network :private_network, ip: "113.0.0.10"

For public (bridged) networks, you will need to modify VMware Fusion's dhcp server (if you are not using your own) as well as the VMX file.


Let me know if that helps.

-Trevor

On Thursday, May 16, 2013 7:31:07 PM UTC-7, James Kyle wrote:
Is it possible to declare what ip a vagrant guest will have?

I only see a few options for this in vagrant

private_network
hostonly network
bridged

When using the vmware plugin (ran into similar problems with virtualbox as well). The private_network and hostonly create or attach to networks with dhcp servers running. If the dhcp server is disabled, vagrant loses the ability to interact with the guest vms for vagrant ssh, mounting drives, and provisioning.

In certain network models, having the host provide dhcp is a deal breaker. For example, when modeling bare metal orchestration using pxe servers or testing dhcp deploys themselves. 

I can't find any option for telling vagrant what the guest IP will be in these situations. Am I just missing it?

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.