You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vagrant.configure(2) do |config|
N = 3 # Amount of machines should be created
(1..N).each do |i| # Set iteration counter from 1 to N
config.vm.define "guest#{i}" do |serv| # Define name + iteration number
serv.vm.box = "bento/ubuntu-24.04"
serv.vm.hostname = "guest#{i}" # Define machine name + iteration number
serv.vm.network "private_network", ip:"192.168.112.10#{i}" # Define ip range +1 based on iteration number
serv.vm.provider "virtualbox" do |vbox|
vbox.memory = "1024"
vbox.name = "guest#{i}" # Define box name + iteration number
vbox.cpus = 2
end
end
end
end
In result we will have:
guest1 -> 192.168.112.101
guest2 -> 192.168.112.102
guest3 -> 192.168.112.103
etc.
In UI it can looks like radio or checkbox where you can choose option what type of ip's use, single or ranged
Hope it helps ;)
The text was updated successfully, but these errors were encountered:
Kol9yN
changed the title
Add IP-address range instead of single address with IP counter iteration
Add IP-address range instead of single address with IP iteration counter
Dec 16, 2024
Here is code example how it will looks in file
In result we will have:
guest1 -> 192.168.112.101
guest2 -> 192.168.112.102
guest3 -> 192.168.112.103
etc.
In UI it can looks like radio or checkbox where you can choose option what type of ip's use, single or ranged
Hope it helps ;)
The text was updated successfully, but these errors were encountered: