1. DHCP
1.1. Intro
DHCP (Dynamic Host Configuration Program) is the standard way to
give computers an IP address without the need of configuration on the computer.
DHCP is capable of much more: assigning gateways, netmask, proxies etcetera, basically
all network configuration can be done via DHCP.
If you are a lazy network administrator at home, you probably use the DHCP server in
your Internet router.
In a data centre, DHCP can be used to give control of the network configuration
to the network administrators. Sysadmins only need to use
dhclient
to get an up-to-date network configuration.
There are some problems with DHCP. For example: you need a network layer 2 connection
with the DHCP server.
1.2. Our virtual machines
We'll use Vagrant to start our virtual machines.
# -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define :xenial1 do |t| t.vm.box = "ubuntu/xenial64" # t.vm.box_url = "file:////links/virt_comp/vagrant/boxes/xenial64.box" t.vm.provider "virtualbox" do |prov| prov.customize ["modifyvm", :id, "--nic2", "hostonly", "--hostonlyadapter2", "vboxnet1" ] prov.customize ["modifyvm", :id, "--macaddress2","020000000001" ] end t.vm.provision "shell", path: "./setup.xenial1.sh" end config.vm.define :xenial2 do |t| t.vm.box = "ubuntu/xenial64" # t.vm.box_url = "file:////links/virt_comp/vagrant/boxes/xenial64.box" t.vm.provider "virtualbox" do |prov| prov.customize ["modifyvm", :id, "--nic2", "hostonly", "--hostonlyadapter2", "vboxnet2" ] prov.customize ["modifyvm", :id, "--macaddress2","020000000002" ] end t.vm.provision "shell", path: "./setup.xenial2.sh" end config.vm.define :xenial3 do |t| t.vm.box = "ubuntu/xenial64" # t.vm.box_url = "file:////links/virt_comp/vagrant/boxes/xenial64.box" t.vm.provider "virtualbox" do |prov| prov.customize ["modifyvm", :id, "--nic2", "hostonly", "--hostonlyadapter2", "vboxnet3" ] prov.customize ["modifyvm", :id, "--macaddress2","020000000003" ] end t.vm.provision "shell", path: "./setup.xenial3.sh" end end
A bit special here is the
prov.customize ["modifyvm", :id, "--macaddress2","020000000003" ]
which forces a specific MAC-ID on eth1. The reason for this is that it allows me to
create a static lease easily.
All setup-scripts contain the following code: