PasteZap
🌐 Português
Grátis · Sem conta

Grátis · Redes e infraestrutura de TI

Gerador de configuração DHCP.

Gere a configuração de servidor DHCPv4 para Kea, ISC dhcpd, dnsmasq, Windows Server e MikroTik, com faixas, opções e reservas.

Antes de começar

Alguns controles técnicos estão em inglês. Textos Unicode são aceitos; os formatos e idiomas de saída dependem da ferramenta.

Os limites técnicos aparecem em inglês abaixo. Confira antes de processar arquivos grandes ou usar o resultado.

CALCULATED IN YOUR BROWSER · NOTHING IS UPLOADED
Reservations
Addresses in the pool100192.168.10.100 – 192.168.10.199
Subnet
192.168.10.0/24 (255.255.255.0)
Gateway
192.168.10.1
Usable addresses outside the pool
154
Lease time
1d

Kea DHCPv4 (kea-dhcp4.conf)

{
  "Dhcp4": {
    "interfaces-config": {
      "interfaces": [
        "eth0"
      ]
    },
    "lease-database": {
      "type": "memfile",
      "persist": true,
      "name": "/var/lib/kea/kea-leases4.csv"
    },
    "valid-lifetime": 86400,
    "max-valid-lifetime": 172800,
    "subnet4": [
      {
        "id": 1,
        "subnet": "192.168.10.0/24",
        "pools": [
          {
            "pool": "192.168.10.100 - 192.168.10.199"
          }
        ],
        "option-data": [
          {
            "name": "routers",
            "data": "192.168.10.1"
          },
          {
            "name": "domain-name-servers",
            "data": "192.168.10.1"
          },
          {
            "name": "domain-name",
            "data": "office.lan"
          }
        ],
        "reservations": [
          {
            "hw-address": "00:1b:63:84:45:e6",
            "ip-address": "192.168.10.20",
            "hostname": "printer"
          },
          {
            "hw-address": "3c:52:82:0a:11:7f",
            "ip-address": "192.168.10.21",
            "hostname": "nas"
          }
        ]
      }
    ]
  }
}

ISC DHCP (dhcpd.conf)

# ISC DHCP (dhcpd.conf). ISC DHCP reached end of life in 2022; Kea is its successor.
option domain-name "office.lan";
option domain-name-servers 192.168.10.1;
default-lease-time 86400;
max-lease-time 172800;
authoritative;

subnet 192.168.10.0 netmask 255.255.255.0 {
  range 192.168.10.100 192.168.10.199;
  option routers 192.168.10.1;
  option broadcast-address 192.168.10.255;
}

host printer {
  hardware ethernet 00:1b:63:84:45:e6;
  fixed-address 192.168.10.20;
}

host nas {
  hardware ethernet 3c:52:82:0a:11:7f;
  fixed-address 192.168.10.21;
}

dnsmasq

interface=eth0
dhcp-range=192.168.10.100,192.168.10.199,255.255.255.0,86400
dhcp-option=option:router,192.168.10.1
dhcp-option=option:dns-server,192.168.10.1
domain=office.lan
dhcp-host=00:1b:63:84:45:e6,printer,192.168.10.20
dhcp-host=3c:52:82:0a:11:7f,nas,192.168.10.21

Windows Server (PowerShell)

Add-DhcpServerv4Scope -Name "192.168.10.0/24" -StartRange 192.168.10.100 -EndRange 192.168.10.199 -SubnetMask 255.255.255.0 -LeaseDuration (New-TimeSpan -Seconds 86400) -State Active
Set-DhcpServerv4OptionValue -ScopeId 192.168.10.0 -Router 192.168.10.1 -DnsServer 192.168.10.1 -DnsDomain "office.lan"
Add-DhcpServerv4Reservation -ScopeId 192.168.10.0 -IPAddress 192.168.10.20 -ClientId "00-1b-63-84-45-e6" -Name "printer"
Add-DhcpServerv4Reservation -ScopeId 192.168.10.0 -IPAddress 192.168.10.21 -ClientId "3c-52-82-0a-11-7f" -Name "nas"

MikroTik RouterOS

/ip pool
add name=pool-eth0 ranges=192.168.10.100-192.168.10.199
/ip dhcp-server
add name=dhcp-eth0 interface=eth0 address-pool=pool-eth0 lease-time=1d
/ip dhcp-server network
add address=192.168.10.0/24 gateway=192.168.10.1 dns-server=192.168.10.1 domain=office.lan
/ip dhcp-server lease
add address=192.168.10.20 mac-address=00:1B:63:84:45:E6 server=dhcp-eth0 comment=printer
add address=192.168.10.21 mac-address=3C:52:82:0A:11:7F server=dhcp-eth0 comment=nas
  • Run only one DHCP server per network segment unless you configure failover.
  • Validate before restarting: kea-dhcp4 -t, dhcpd -t, dnsmasq --test.

Como usar esta ferramenta: Gerador de configuração DHCP

Insira os dados ou escolha o arquivo. Ajuste as opções, gere o resultado e confira antes de copiar ou baixar.

Limites e formatos aceitos

Seus dados são processados no seu dispositivo.

Notas técnicas em inglês

DHCPv4 only; no failover, relay or DHCPv6 settings. Reservation rules differ: Windows needs them inside the scope, others prefer them outside the pool. Everything is calculated in your browser; nothing is sent or probed on the network.

Addresses, MACs and options are validated once, then written in each server’s syntax. MAC addresses are normalised to the separator each product expects.

192.168.10.0/24 with pool .100–.199, gateway .1 and two reservations produces matching kea-dhcp4.conf, dhcpd.conf, dnsmasq, PowerShell and RouterOS files.