Generate new MAC address

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

Generate new MAC address

Zachary Buckholz
I have created a base linux box which I can init and up without any problems. But when I attempt to launch a second box I get another box with the same ip and MAC address. Both boxes work without problems, no log entries about duplicate IPs or MACs. How can I force a new MAC and IP each time a new box is initialized and turned on?

mkdir test1
cd test1
vagrant init CentOS
vagrant up

cd ..
mkdir test2
cd test2
vagrant init CentOS
vagrant up

After doing the above steps, both hosts have the same IP and MAC address.

Thanks
Zach

--
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: Generate new MAC address

Bjørge Solli
On 02. aug. 2013 01:41, Zachary Buckholz wrote:
> I have created a base linux box which I can init and up without any
> problems. But when I attempt to launch a second box I get another box
> with the same ip and MAC address. Both boxes work without problems, no
> log entries about duplicate IPs or MACs. How can I force a new MAC and
> IP each time a new box is initialized and turned on?
Is this a NAT-network? If so this is not a problem. If this is a private
network you should let vagrant create the network adapters, then you
will get a new mac-adr every time.

I do something like this:
config.vm.network :private_network, ip: "192.168.33.10", :adapter => 2

Regards
Bjørge

--
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.