A
A
Andrey Pupyshev2018-12-29 01:41:32
linux
Andrey Pupyshev, 2018-12-29 01:41:32

How to setup dhcp on ubuntu 18.04?

Hey! guys help me to make it so that the Internet goes from the external local network to the internal network
Given:
- Virtualbox (last)
- Ubuntu 18.04 LTS (client)
- Ubuntu Server 18.04 (dhcp)
dhcp settings:
dhcpd.conf

dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
# option definitions common to all supported networks...
#option domain-name "pupyshev";
#option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
#log facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#
#subnet 192.168.1.89 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
#subnet 10.254.239.0 netmask 255.255.255.224 {
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
subnet 10.0.1.0 netmask 255.255.255.0 {
authoritative;
range 10.0.1.2 10.0.1.10;
# option domain-name-servers ns1.internal.example.org;
option domain-name "local.pupyshev.local";
option subnet-mask 255.255.255.0;
option routers 10.0.1.0;
option broadcast-address 10.0.1.255;
default-lease-time 600;
max-lease-time 7200;
# allocated dynamically (if possible), but the host-specific information
isc-dhcp-server settings:
INTERFACESv4="ets32"
Settings: /etc/netplan
50-cloud-init.yaml:
network:
ethernets:
ens32:
addresses:
- 10.0 .1.1/24
dhcp4: false
gateway4: 10.0.1.1
nameservers:
addresses:
- 10.0.1.1
search: []
ens33:
addresses:
- 192.168.1.89/24
dhcp4: false
gateway4: 192.168.1.1
nameservers:
addresses:
- 192.168.1.1
search: []
version: 2

Result :
5c26a5bd40dd5293075245.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2018-12-29
@Andrey_OM

What confuses you? The impossibility of translating the phrase "no subnet declarations"? We read the documentation, write a description of the subnet, specify the necessary parameters.
JFYI: dhcpd only knows dhcpd.conf, it doesn't care about any other files at all.

H
hint000, 2018-12-29
@hint000

option routers 10.0.1.0;
- here in dhcp correct the gateway address to 10.0.1.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question