Last active
September 28, 2022 00:16
-
-
Save david-botelho-mariano/f50b1517e8e89c3b48673c9f0ebc3ed7 to your computer and use it in GitHub Desktop.
DHCP with Vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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