フリーソフトウェアのコンパイル

isc-dhcpd の作成

Solaris8 07/03 + gcc な環境

ソース

コンパイル,インストール

  % ./configure
  % make
  # make install

これで, /usr/sbin/ 以下に dhcpd など, 関係するコマンドがインストールされる.

起動ファイルのコピー

 # sed s/@PREFIX@/\\/usr/g contrib/solaris.init | \
   sed s/usr\\/etc\\/dhcpd.pid/etc\\/dhcpd.pid/g \
   > /etc/init.d/isc-dhcpd
 # chmod +x /etc/init.d/isc-dhcpd
 # ln -s ../init.d/isc-dhcpd /etc/rc2.d/S99isc-dhcpd
 # ln -s ../init.d/isc-dhcpd /etc/rc0.d/K01isc-dhcpd
 # vi /etc/init.d/isc-dhcpd
 ----------------------------------------------------
 # start) のところに以下のものを加えておく.
 if[ -f /etc/dhcpd.pid ]; then
     rm /etc/dhcpd.pid
 fi
 ----------------------------------------------------

設定

servers/dhcpd.conf にサンプルの設定ファイルがあるので, これを利用する.

 # cp server/dhcpd.conf /etc
 # vi /etc/dhcpd.conf
 -------------------------------------------------------------
 # dhcpd.conf
 #
 # Sample configuration file for ISC dhcpd
 #
 
 # option definitions common to all supported networks...
 option domain-name "XXX.example.jp";
 option domain-name-servers 172.16.0.11;
 ddns-update-style none;
 
 default-lease-time 6000;
 max-lease-time 72000;
 
 # If this DHCP server is the official DHCP server for the local
 # network, the authoritative directive should be uncommented.
 #authoritative;
 
 # Use this to send dhcp log messages to a different log file (you also
 # have to hack syslog.conf to complete the redirection).
 log-facility local7;
 # This is a very basic subnet declaration.
 
 #
 # Authenticated VLAN
 #
 subnet 172.16.0.0 netmask 255.255.0.0 {
   range 172.16.1.1 172.16.1.253;
   option routers 172.16.0.10;
 #
   ddns-update-style interim;
   ddns-domainname "xxx.example.jp";
   ddns-rev-domainname "in-addr.arpa";
   zone xxx.example.jp. {
     primary 172.16.0.11;
   }
   zone 1.16.172.in-addr.arpa. {
     primary 172.16.0.11;
   }
 }
 
 #
 # Dafault VLAN
 #
 subnet 192.168.0.0 netmask 255.255.255.0 {
   default-lease-time 300;
   max-lease-time 300;
   range 192.168.0.100 192.168.0.199;
   option routers 192.168.0.1;
 }
 -------------------------------------------------------------

フェイルオーバの設定

tests/failover/ 内にフェイルオーバをする時の 設定ファイルのサンプルがある.

ます,現行の設定を共通の設定とするため,

 # mv /etc/dhcpd.conf /etc/dhcpd-master.conf

として,名前を変えておく. そして,failover 用の設定も加えておく

 # dhcpd.conf
 #
 # Sample configuration file for ISC dhcpd
 #
 
 # option definitions common to all supported networks...
 option domain-name "XXX.example.jp";
 option domain-name-servers 172.16.0.11;
 ddns-update-style none;
 
 default-lease-time 6000;
 max-lease-time 72000;
 
 # If this DHCP server is the official DHCP server for the local
 # network, the authoritative directive should be uncommented.
 #authoritative;
 
 # Use this to send dhcp log messages to a different log file (you also
 # have to hack syslog.conf to complete the redirection).
 log-facility local7;
 
 # This is a very basic subnet declaration.
 
 #
 # Authenticated VLAN
 #
 subnet 172.16.0.0 netmask 255.255.0.0 {
   pool{                                    # <--このあたり
     deny dynamic bootp clients;            # <--このあたり
     range 172.16.1.1 172.16.1.253;
     option routers 172.16.0.10;
     failover peer "test";                  # <--このあたり
   }                                        # <--このあたり
 }
 
 #
 # Dafault VLAN
 #
 subnet 192.168.0.0 netmask 255.255.0.0 {
   pool{                                    # <--このあたり
     deny dynamic bootp clients;            # <--このあたり
     default-lease-time 300;
     max-lease-time 300;
     range 192.168.0.100 192.168.0.199;
     option routers 192.168.0.1;
     failover peer "test";                  # <--このあたり
   }                                        # <--このあたり
 }

これを,お互いのサーバにコピーし,設定ファイル中で 読み込んで使う.

プライマリサーバ側の設定ファイル

 # dhcpd.conf for primary
 #
 authoritative;
 failover peer "test" {
   primary;
   address 172.16.0.12;
   port 10001;
   peer address 172.16.0.22;
   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/dhcpd-master.conf";

セカンダリサーバ側の設定ファイル

 # dhcpd.conf for primary
 #
 authoritative;
 failover peer "test" {
   #primary;
   secondary;
   address 172.16.0.22;
   port 10001;
   peer address 172.16.0.12;
   peer port 10001;
   max-response-delay 60;
   max-unacked-updates 10;
 }
 
 include "/etc/dhcpd-master.conf";

起動

一番最初に起動する前には

 # touch /etc/dhcpd.leases

をしておくこと.


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2004-04-28 (水) 17:15:11