Skip to content

Instantly share code, notes, and snippets.

@david-botelho-mariano
Last active September 28, 2022 00:16
Show Gist options
  • Save david-botelho-mariano/f50b1517e8e89c3b48673c9f0ebc3ed7 to your computer and use it in GitHub Desktop.
Save david-botelho-mariano/f50b1517e8e89c3b48673c9f0ebc3ed7 to your computer and use it in GitHub Desktop.
DHCP with Vagrant
# https://www.tecmint.com/install-dhcp-server-client-on-centos-ubuntu/
$script = <<-SCRIPT
sudo apt install isc-dhcp-server -y
sudo systemctl start isc-dhcp-server
sudo systemctl enable isc-dhcp-server
SCRIPT
class VagrantPlugins::ProviderVirtualBox::Action::Network
def dhcp_server_matches_config?(dhcp_server, config)
true
end
end
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network "private_network", type: "dhcp"
config.vm.provision "shell", inline: $script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment