Configure LAN IP Address in vagrant file

112 views
Skip to first unread message

govind parashar

unread,
Jan 13, 2016, 5:06:36 AM1/13/16
to Vagrant
Hello

I have centos7 machine, which is on my local LAN. This machine IP is 172.16.72.245, In this I have installed vagrant and virtualBox on the same. I have written  vagrant file which contains below code to create a VM. I need to assign static IP i.e. 172.16.72.246 to new VM, Please suggest me how do it.

Code Snippet

Vagrant.configure(2) do |config| 
  config.vm.box = "vStone/centos-7.x-puppet.3.x"
  config.vm.hostname = "Jenkins-box"
  config.vm.box_check_update = false
  config.vm.network "private_network", ip: "172.16.72.246"
  config.vm.synced_folder "../../", "/vshare/", create: true
  
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "2048"
    vb.cpus = "1"
  end
end




 

govind parashar

unread,
Jan 13, 2016, 5:55:42 AM1/13/16
to Vagrant
I am able to do that by using 
config.vm.network  "public_network", bridge: 'eth1', ip: "172.16.72.246"
Reply all
Reply to author
Forward
0 new messages