*DHCP [#cca95890] #contents *DDNSインストール [#x515575a] [[ISC DHCP Production Release Info:http://www.isc.org/sw/dhcp/dhcp_rel.php]] $ wget http://ftp.isc.org/isc/dhcp/dhcp-3.0.4.tar.gz $ tar xzvf dhcp-3.0.4.tar.gz $ cd dhcp-3.0.4 $ ./configure $ make $ su # make install # touch /var/state/dhcp/dhcpd.leases *設定 [#nba7ce3a] **/etc/dhcp.conf [#c8e17e1c] #Sample configuration file for ISC dhcpd # ddns-update-style interim; default-lease-time 600; #クライアントIPアドレスのデフォルトリース時間 max-lease-time 7200; #クライアントIPアドレスの最大リース時間 log-facility local7; #ログ出力の指定 option domain-name "xx.net"; #クライアントに付与するドメイン option domain-name-servers 192.168.1.10; #クライアントに付与するDNSサーバ subnet 192.168.1.0 netmask 255.255.255.0 { #DHCPを動作させるネットワークインターフェイスの情報 range 192.168.1.100 192.168.1.200; #クライアントに付与するIPアドレス option routers 192.168.1.1; #クライアントに付与するデフォルトルータのアドレス } zone xx.net. { primary 192.168.1.10; } zone 1.168.192.in-addr.arpa. { primary 192.168.1.10; } **/etc/named.conf [#p0109495] 変更点のみ // xx.net の正引きの設定(内部用ドメイン) zone "xx.net" { // Master DNS Serverであることを明示 // 内部から *.xx.net を引いたときにきちんと見えるよう設定 type master; // ファイル名 file "xx.net"; allow-update{ # <- DNSをUpdate可能な範囲を指定しておく 192.168.1.10; 127.0.0.1; }; }; // 192.168.1.* の逆引きの設定 zone "1.168.192.in-addr.arpa" { // Master DNS Serverであることを明示 type master; // ファイル名 file "1.168.192.in-addr.arpa"; allow-update{ # <- DNSをUpdate可能な範囲を指定しておく 192.168.1.10; 127.0.0.1; }; }; **設定ファイル権限設定 [#k8a906da] # cd /var/named # chown named:named * *動作確認 [#l4b6232e] $ nsupdate -d > update add ryvius.xx.net. 3600 in a 192.168.1.100 > send > update add 100.1.168.192.in-addr.arpa. 3600 in ptr ryvius.xx.net. > send > quit $ host ryvius.xx.net $ host 192.168.1.100 $ nsupdate -d > update delete ryvius.xx.net. > send > update delete 100.1.168.192.in-addr.arpa. > send > quit $ host ryvius.xx.net $ host 192.168.1.100 *自動起動設定 [#k65c5713] -/etc/init.d/dhcpd #!/bin/bash # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -f /usr/sbin/dhcpd ] || exit 0 [ -r /etc/dhcpd.conf ] || exit 0 RETVAL=0 prog="dhcpd" start() { # Start daemons. echo -n $"Starting $prog: " daemon /usr/sbin/dhcpd ${OPTIONS} RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd echo return $RETVAL } stop() { # Stop daemons. echo -n $"Shutting down $prog: " # /usr/sbin/rndc stop killproc dhcpd RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcpd echo return $RETVAL } restart() { stop sleep 2 start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; condrestart) [ -f /var/lock/subsys/named ] && restart || : ;; *) echo "Usage: named {start|stop|restart|condrestart}" exit 1 esac exit $? # cd /etc/rc3.d # ln -s ../init.d/dhcpd S99dhcpd # cd /etc/rc5.d # ln -s ../init.d/dhcpd S99dhcpd *参考サイト [#lb9fd4d2] [[ISC DHCP Production Release Info:http://www.isc.org/sw/dhcp/dhcp_rel.php]] [[@IT:DHCPとDynamic DNSの連携システム(1/2):http://www.atmarkit.co.jp/flinux/rensai/bind908/bind908a.html]] [[ISC DHCPのインストール:http://unix-study.com/unix/install/dhcp/index.html]] [[nsupdate command:http://wwwj2.comp.eng.himeji-tech.ac.jp/home/keisuke/nsupdate.html]]