1- run a command (+ a path )
2- run a command with a path ( usually a script )
https://www.vagrantup.com/docs/provisioning/shell.html
1- run a command
edit Vagrantfile:
$script = <<SCRIPT
sudo -i
ip link set enp0s3 down
ip route add default via 192.168.0.1
sed -i '$ d' /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "public_network", bridge: "Intel(R) Ethernet Connection I219-LM" , ip: "192.168.0.101"
config.vm.hostname = "master"
config.vm.provision "shell", inline: $script
end