2009年6月23日

ISC DHCP 3.0.7 on FreeBSD 6.X

 2台のFreeBSDサーバを使用し、DHCPサーバの冗長化を図った。

1.ISC DHCPサーバのインストール
portsを利用する。

/usr/ports/net/isc-dhcp30-server/
+[X] DHCP_LDAP
# make
# make install

2.設定

# vi /etc/rc.conf
 dhcpd_enable="YES"
 dhcpd_ifaces="em0" #サービス提供予定のNICを指定(複数NICの場合)
# vi /etc/syslog.conf
 local7.* /var/log/dhcp.log
# vi /etc/newsyslog.conf
 /var/log/dhcp.log 644 12 * 168 JC
# cp /usr/local/etc/dhcpd.conf.sample /usr/local/etc/dhcpd.conf
# vi /usr/local/etc/dhcpd.conf
 ddns-update-style none;
 not authoritative; # 2台のDHCPサーバを立てる場合
 log-facility local7;
 subnet 192.168.255.0 netmask 255.255.255.0 {
  range 192.168.255.32 192.168.255.64;
  option domain-name-servers 192.168.255.2;
  option domain-name "p.oni.gr.jp";
  option routers 192.168.255.254;
  option broadcast-address 192.168.255.255;
  default-lease-time 600;
  max-lease-time 7200;
 }
 # IPを固定
 host cam1 {
  hardware ethernet 0:0:c0:5d:bd:95;
  fixed-address cam1.p.oni.gr.jp;
 }
 # primary設定
 failover peer "oni" {
  primary;
  address ex1.p.oni.gr.jp;
  port 519;
  peer address ex2.p.oni.gr.jp;
  peer port 519;
  max-response-delay 60;
  max-unacked-updates 10;
  mclt 3600;
  split 128;
  load balance max seconds 3;
 }
 # secondary設定
 failover peer "oni" {
  secondary;
  address ex2.p.oni.gr.jp;
  port 519;
  peer address ex1.p.oni.gr.jp;
  peer port 519;
  max-response-delay 60;
  max-unacked-updates 10;
 }

3.起動
# /usr/local/etc/rc.d/isc-dhcpd start

4.停止
# /usr/local/etc/rc.d/isc-dhcpd stop

5.確認
# tail -f /var/log/dhcp.log

[DHCP][FreeBSD] : 2009年6月23日 21:50