PasteZap
🌐 日本語
無料 · アカウント不要

無料 · ネットワーク・IT インフラ

DHCP 設定ジェネレーター.

Kea、ISC dhcpd、dnsmasq、Windows Server、MikroTik 向けに、アドレスプール・オプション・予約を含む DHCPv4 サーバー設定を生成します。

はじめる前に

一部の技術的な操作項目は英語です。Unicode テキストに対応していますが、ファイル形式と出力言語はツールによって異なります。

技術的な制限は以下に英語で記載されています。大きなファイルを処理する前や結果を使用する前に確認してください。

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.

使い方: DHCP 設定ジェネレーター

データを入力するかファイルを選び、設定を調整して結果を生成します。コピーやダウンロードの前に結果を確認してください。

制限と対応形式

入力内容はお使いの端末で処理されます。

英語の技術説明

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.