how to configure DHCP Server on Ubuntu Server 20.04



how to configure DHCP Server on Ubuntu Server 20.04

how to configure DHCP Server on Ubuntu Server 20.04

Assign Static IP Address on Ubuntu 20.04 LTS and Configure DHCP:

step1: check if /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg is disable. like this :network: {config: disabled}
step2:check name: ip add show and install : sudo apt-get install isc-dhcp-server &sudo nano /etc/dhcp/dhcpd.conf
put this code:
subnet 172.16.1.0 netmask 255.255.255.0 {
range 172.16.1.80 192.16.1.90;
option routers 172.16.1.1;
option domain-name-servers 172.16.1.2, 172.16.1.3;
option domain-name “example.com”;
}
step3: nano /etc/netplan/00-installer-config.yaml
step4: add this code:
network:
ethernets:
enp0s3:
addresses: [172.16.1.3/24]
gateway4: 172.168.1.1
nameservers:
addresses: [4.2.2.2, 8.8.8.8]
version: 2

to reserve an ip:
host Server1 {
hardware ethernet 00:00:00:20:c0:a5;
fixed-address 172.16.1.88;
}
step5:sudo netplan apply& sudo isc-dhcp-server restart .

Comments are closed.