0% found this document useful (0 votes)
9 views3 pages

Tema 2

The document details the steps to configure a DHCP server to provide IP addresses to clients, install and configure a DNS server for name resolution within the network, enable DNS caching, and configure the DHCP server to provide the DNS server IP to clients.

Uploaded by

edmodanez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Tema 2

The document details the steps to configure a DHCP server to provide IP addresses to clients, install and configure a DNS server for name resolution within the network, enable DNS caching, and configure the DHCP server to provide the DNS server IP to clients.

Uploaded by

edmodanez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

TEMA 2

1. Instalação e configuração de servidor DHCP para oferecer uma faixa de pelo menos
10 endereços IP para equipamentos com perfil cliente
"sudo apt update
sudo apt install isc-dhcp-server"

"cat /etc/dhcp/dhcpd.conf"
# Definição do domínio
option domain-name "lan";
option domain-name-servers 192.168.1.2;

# Tempo de concessão do lease


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

# Não usar DDNS


ddns-update-style none;
authoritative;

# Subrede e intervalo de IPs fornecidos pelo DHCP


subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.150;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.2;
}

sudo systemctl status isc-dhcp-server


● isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
Active: active (running) since Tue 2024-06-04 00:25:35 -03; 57min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 4 (limit: 2324)
Memory: 6.3M
CPU: 167ms
CGroup: /system.slice/isc-dhcp-server.service
└─10233 /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf enp0s3

jun 04 01:07:22 debian dhcpd[10233]: DHCPACK on 192.168.1.100 to 08:00:27:42:d0:c4


(debian) via enp0s3
jun 04 01:16:06 debian dhcpd[10233]: DHCPREQUEST for 192.168.1.100 from
08:00:27:42:d0:c4 (debian) via enp0s3
jun 04 01:16:06 debian dhcpd[10233]: DHCPACK on 192.168.1.100 to 08:00:27:42:d0:c4
(debian) via enp0s3
jun 04 01:16:15 debian dhcpd[10233]: reuse_lease: lease age 9 (secs) under 25%
threshold, reply with unaltered, existing lease for 192.168.1.100
jun 04 01:16:15 debian dhcpd[10233]: DHCPDISCOVER from 08:00:27:42:d0:c4 (debian)
via enp0s3
jun 04 01:16:15 debian dhcpd[10233]: DHCPOFFER on 192.168.1.100 to
08:00:27:42:d0:c4 (debian) via enp0s3
jun 04 01:16:15 debian dhcpd[10233]: reuse_lease: lease age 9 (secs) under 25%
threshold, reply with unaltered, existing lease for 192.168.1.100
jun 04 01:16:15 debian dhcpd[10233]: DHCPREQUEST for 192.168.1.100 (192.168.1.2)
from 08:00:27:42:d0:c4 (debian) via enp0s3
jun 04 01:16:15 debian dhcpd[10233]: DHCPACK on 192.168.1.100 to 08:00:27:42:d0:c4
(debian) via enp0s3

3. Instalação e configuração do servidor DNS, para o domínio criado (e seu reverso)


para todas as máquinas (servidoras e clientes) da intranet
"sudo apt update
sudo apt install bind9"

"cat /etc/bind/named.conf.local"
zone "trabalho2023.local" {
type master;
file "/etc/bind/db.trabalho2023.local";
};

zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192.168.1";
};

"cat /etc/bind/db.trabalho2023.local"
$TTL 604800
@ IN SOA ns.trabalho2023.local. root.trabalho2023.local. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.trabalho2023.local.
ns IN A 192.168.1.2
@ IN A 192.168.1.2

"cat /etc/bind/db.192.168.1"
$TTL 604800
@ IN SOA ns.trabalho2023.local. root.trabalho2023.local. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.trabalho2023.local.
2 IN PTR trabalho2023.local.

4. Habilitação do DNS cache para oferecer resolução de nomes à intranet


"cat /etc/bind/named.conf.options"
options {
directory "/var/cache/bind";

// If there is a firewall between you and nameservers you want


// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113

// If your ISP provided one or more IP addresses for stable


// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.

// forwarders {
// 0.0.0.0;
// };

//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
forwarders {
8.8.8.8;
8.8.4.4;
};

dnssec-validation auto;

listen-on-v6 { any; };
};

5. Configuração do DNS via DHCP para clientes da intranet

"cat /etc/dhcp/dhcpd.conf"
# Definição do domínio
option domain-name "lan";
option domain-name-servers 192.168.1.2;

# Tempo de concessão do lease


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

# Não usar DDNS


ddns-update-style none;
authoritative;

# Subrede e intervalo de IPs fornecidos pelo DHCP


subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.150;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.2;
}

You might also like