M
M
maniac_by2018-10-13 15:59:30
linux
maniac_by, 2018-10-13 15:59:30

How to properly set up dhcp on ubuntu 18.04?

Hello. Please help me figure out how to set up a DHCP server and get an IP.
Given:
- Virtualbox (latest)
- Ubuntu 18.04 LTS (client)
- Ubuntu Server 18.04 (dhcp)
- virtualbox internal-network
dhcp settings:
dhcpd.conf:

# minimal sample /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;

subnet 192.168.33.0 netmask 255.255.255.0 {
 range 192.168.33.20 192.168.33.50;
 option routers 192.168.33.254;
 option domain-name-servers 192.168.33.1, 192.168.33.2;
 option domain-name "ubuntu.local";
}

isc-dhcp-server settings:
INTERFACESv4="enp0s3"
Settings: /etc/netplan
50-cloud-init.yaml:
enp0s3:
    addresses: [192.168.33.20/24, ]
    dhcp4: no
    dhcp6: no
    gateway4: 192.168.33.1
    nameservers:
      addresses: [8.8.8.8, 8.8.4.4]

Ubuntu 18.04 just has Auto IP (DHCP) in the settings,
but does not receive an address. Tell me why, please. If there are ideas.
DHCP Status
5bc1ef08844e6421700972.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
maniac_by, 2018-10-13
@maniac_by

5bc24583225a5470203203.png

default-lease-time 600;
max-lease-time 7200;

subnet 192.168.33.0 netmask 255.255.255.0 {
 range 192.168.33.20 192.168.33.50;
 option routers 192.168.33.254;

M
mikes, 2018-10-13
@mikes

dhcpd -t allows you to test the config and find errors.
given that vbox and its internal network are used, but at the same time the config contains an indication of a real device (why is it interesting), then the client will not receive anything there even with a working network.
just in case I will attach part of my config in the place where the networks are described

subnet 10.10.50.0 netmask 255.255.255.0 {
option broadcast-address 10.10.50.255;
ddns-updates on;
ddns-domainname "rectorat.******.ru";
authoritative;
option ntp-servers 172.16.20.100;
option time-servers 172.16.20.100;
option routers 10.10.50.1;
option subnet-mask 255.255.255.0;
option domain-name "rectorat.******.ru";
option domain-name-servers 172.16.11.41;
option nis-domain "rectorat.******.ru";
option local-pac-server " http://wpad.******.ru:80/wpad.dat\000 " ;
pool {
range 10.10.50.10 10.10.50.200;
default-lease-time 504800;
max-lease-time 604800;
} }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question