玄箱X4/サーバー設定/dhcp3-server

提供: fukudat
移動: 案内検索

DHCP service.

primary1台またはprimary, secondaryの2台構成を仮定.

Install

# apt-get install dhcp3-server

Configure

/etc/dhcp3/dhcpd.primary を作成・編集

# HAの設定をする場合.しない場合はこのセクションはコメントアウト
failover peer "test" {
    primary;
    address 192.168.0.11;
    port 10001;
    peer address 192.168.0.12;
    peer port 10001;
    max-response-delay 60;
    max-unacked-updates 10;
    mclt 3600;
    hba ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:
        00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;
    load balance max seconds 3;
}

include "/etc/dhcp3/dhcpd.master";

/etc/dhcp3/dhcpd.secondary を作成・編集

failover peer "test" {
    secondary;
    address 192.168.0.12;
    port 10001;
    peer address 192.168.0.11;
    peer port 10001;
    max-response-delay 60;
    max-unacked-updates 10;
}

include "/etc/dhcp3/dhcpd.master";

/etc/dhcp3/dhcpd.master を作成・編集

option domain-name "fukudat.com";
option domain-name-servers 192.168.0.14, 192.168.0.12;

default-lease-time 3600;
max-lease-time 86400;

ddns-update-style interim;
ddns-domainname "fukudat.com";
ddns-rev-domainname "in-addr.arpa";

subnet 192.168.0.0 netmask 255.255.255.0 {
        authoritative;
        option broadcast-address 192.168.0.255;
        option routers 192.168.0.1;
        option subnet-mask 255.255.255.0;
        pool {
                #failover peer "test";
                deny dynamic bootp clients;
                range 192.168.0.100 192.168.0.250;
        }

        # 固定IPの設定    
        host takeshi {
                hardware ethernet xx:xx:xx:xx:xx:xx;  # MACアドレス
                fixed-address takeshi.fukudat.com;    # 固定IPアドレス
        }
}
log-facility local7;

dhcpd.conf を dhcpd.primary または dhcpd.secondary にシンボリックリンクする.

# mv -f dhcpd.conf dhcpd.conf.orig
# ln -s dhcpd.primary dhcpd.conf または ln -s dhcpd.secondary dhcpd.conf

dhcpdを再起動

# /etc/init.d/dhcp3-server restart

参考文献

個人用ツール
名前空間

変種
操作
案内
ツールボックス